Error exporting to excel

RoddyMcLean
Member Posts: 101
I am getting an error using the Excel Buffer table to export: -
This message is for C/AL programmers
An exception occurred from an external component. The component did not provide the exception description.
Excel Table Buffer -
CreateSheet(SheetName,ReportHeader,CompanyName,UserID2)
REPEAT
RecNo := RecNo + 1;
Window.UPDATE(1,ROUND(RecNo / TotalRecNo * 10000,1));
IF NumberFormat <> '' THEN
XlWorkSheet.Range(xlColID + xlRowID).NumberFormat := NumberFormat;
IF Formula = '' THEN
It is failing on this line
XlWorkSheet.Range(xlColID + xlRowID).Value := "Cell Value as Text"
Any suggestions?
I have set up the data as follows: -
recExcelBuffer.xlRowID := 'A';
recExcelBuffer.xlColID := '1';
recExcelBuffer."Cell Value as Text" := '5';
recExcelBuffer.INSERT;
recExcelBuffer.CreateBook;
recExcelBuffer.CreateSheet('ROD','',COMPANYNAME,USERID);
This message is for C/AL programmers
An exception occurred from an external component. The component did not provide the exception description.
Excel Table Buffer -
CreateSheet(SheetName,ReportHeader,CompanyName,UserID2)
REPEAT
RecNo := RecNo + 1;
Window.UPDATE(1,ROUND(RecNo / TotalRecNo * 10000,1));
IF NumberFormat <> '' THEN
XlWorkSheet.Range(xlColID + xlRowID).NumberFormat := NumberFormat;
IF Formula = '' THEN
It is failing on this line
XlWorkSheet.Range(xlColID + xlRowID).Value := "Cell Value as Text"
Any suggestions?
I have set up the data as follows: -
recExcelBuffer.xlRowID := 'A';
recExcelBuffer.xlColID := '1';
recExcelBuffer."Cell Value as Text" := '5';
recExcelBuffer.INSERT;
recExcelBuffer.CreateBook;
recExcelBuffer.CreateSheet('ROD','',COMPANYNAME,USERID);
0
Comments
-
Have you tried to use the example provided in report 29 Export Acc. Sched. to Excel ?
EnterCell(RowNo : Integer;ColumnNo : Integer;CellValue : Text[50];Bold : Boolean;Italic : Boolean;UnderLine : Boolean) TempExcelBuffer.INIT; TempExcelBuffer.VALIDATE("Row No.",RowNo); TempExcelBuffer.VALIDATE("Column No.",ColumnNo); TempExcelBuffer."Cell Value as Text" := CellValue; TempExcelBuffer.Formula := ''; TempExcelBuffer.Bold := Bold; TempExcelBuffer.Italic := Italic; TempExcelBuffer.Underline := UnderLine; TempExcelBuffer.INSERT;
0 -
As far as I understand this (I'm new to this particular topic myself) you keep track of rows and columns with integer values, and the validation code of the Excel Buffer table will translate that into Excel values.0
-
Thanks guys, got this working0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions