Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Excel Buffer overwrites format NAV 2016

$
0
0
In the past(NAV 2009 R2) I have used the Excel buffer to import a spreadsheet make a few changes and export it back out. This worked nice and preserved the formatting unless I specifically change the formatting such as bolding or underline.
I am finding in NAV 2016 I am losing the formatting. If I simply import a sheet and export it out with no changes it loses all the formatting.

Here is a quick sample of what I am talking about:
//Read File into Excel Buffer
FullFileName := 'C:\Users\myusername\Desktop\Book1.xlsx';
OriginalFileName := FullFileName;
FullFileName := FileMgt.UploadFileSilent(FullFileName);
ExcelSheetName := ExcelBuffer.SelectSheetsName(FullFileName);
ExcelBuffer.OpenBook(FullFileName,ExcelSheetName);
ExcelBuffer.ReadSheet;

//Write File back to spreadsheet
ExcelBuffer.UpdateBook(FullFileName,ExcelSheetName);
ExcelBuffer.WriteSheet('Report Header','SWK',USERID);
ExcelBuffer.CloseBook;
ExcelBuffer.OverwriteAndOpenExistingExcel(OriginalFileName);
ExcelBuffer.GiveUserControl;

How do I preserve the formatting that already existed on the sheet such as cell color, word color etc...

Viewing all articles
Browse latest Browse all 10032

Trending Articles