Error When Running CloseBook Function in Exporting to Excel
donnaprieto
Member Posts: 3
Hi,
Is there anyone here who already encounter this kind of error in exporting to excel in NAV2013?
I'm encountering this error when I tried to run my customized report for BIRForm2307 to Update an excel worksheet. I've tried to debug it and it stops at the code recExcelBuffer.CloseBook;
Kindly help me please on how to fix this issue, it almost 1 week since I've been trying to solve this bug. ](*,)
1. Code that runs the excel buffer. The error prompts on the third line below
recExcelBuffer.UpdateBook(txt2307TemplatePath,SheetName);
recExcelBuffer.WriteSheet('',COMPANYNAME,USERID);
recExcelBuffer.CloseBook;
recExcelBuffer.OverwriteAndOpenExistingExcel(txt2307TemplatePath);
recExcelBuffer.GiveUserControl;
2. CloseBook Fuction
IF NOT ISNULL(XlWrkBkWriter) THEN BEGIN
XlWrkBkWriter.ValidateDocument;
XlWrkBkWriter.Close;
CLEAR(XlWrkShtWriter);
CLEAR(XlWrkBkWriter);
END;
IF NOT ISNULL(XlWrkBkReader) THEN BEGIN
CLEAR(XlWrkShtReader);
CLEAR(XlWrkBkReader);
END;
Your suggestions and comments will much appreciated. [-o<
Thanks,
Donna
Is there anyone here who already encounter this kind of error in exporting to excel in NAV2013?
I'm encountering this error when I tried to run my customized report for BIRForm2307 to Update an excel worksheet. I've tried to debug it and it stops at the code recExcelBuffer.CloseBook;
Kindly help me please on how to fix this issue, it almost 1 week since I've been trying to solve this bug. ](*,)
1. Code that runs the excel buffer. The error prompts on the third line below
recExcelBuffer.UpdateBook(txt2307TemplatePath,SheetName);
recExcelBuffer.WriteSheet('',COMPANYNAME,USERID);
recExcelBuffer.CloseBook;
recExcelBuffer.OverwriteAndOpenExistingExcel(txt2307TemplatePath);
recExcelBuffer.GiveUserControl;
2. CloseBook Fuction
IF NOT ISNULL(XlWrkBkWriter) THEN BEGIN
XlWrkBkWriter.ValidateDocument;
XlWrkBkWriter.Close;
CLEAR(XlWrkShtWriter);
CLEAR(XlWrkBkWriter);
END;
IF NOT ISNULL(XlWrkBkReader) THEN BEGIN
CLEAR(XlWrkShtReader);
CLEAR(XlWrkBkReader);
END;
Your suggestions and comments will much appreciated. [-o<
Thanks,
Donna
0
Answers
-
Maybe a silly suggestion...have you checked in NAV the source fields used to populate data in Excel?
I guess there is some non-printable character somewhere which causes the problem, you can find it out with a loop such as:FOR i := 1 TO STRLEN(YourTable.TextField) DO BEGIN MyIntVar := YourTable.TextField[i]; IF MyIntVar > 128 THEN ERROR(...); END;* Daniele Rebussi * | * Rebu NAV Diary *0 -
hi Geordie,
thanks for that.
I already resolved the bug, you're right that its from the function I used to populate data in Excel.
The error occurs in the field that does not have any value where it is pass to a function that needs to be separated by cell.
Whew. \:D/
Thanks again.
Donna0 -
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 250 Dynamics CRM
- 102 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
