Excel Error after automation

Alex
Member Posts: 54
Hello,
I have following problem, i use the code below:
CREATE(xlApp); xlBook := xlApp.Workbooks.Add(-4167); xlsheet := xlApp.ActiveSheet; xlsheet.Name := 'Projekt Statistik'; ....... ...... .... xlApp.Visible := TRUE CLEAR(xlApp);
And if all datas are exportes to excel i get an Dr. Watson ( Error) afer i close Excel (manuelly) !
Anyone knows whats work, maybe i must unlink the session ?!
I have following problem, i use the code below:
CREATE(xlApp); xlBook := xlApp.Workbooks.Add(-4167); xlsheet := xlApp.ActiveSheet; xlsheet.Name := 'Projekt Statistik'; ....... ...... .... xlApp.Visible := TRUE CLEAR(xlApp);
And if all datas are exportes to excel i get an Dr. Watson ( Error) afer i close Excel (manuelly) !
Anyone knows whats work, maybe i must unlink the session ?!
Best regards
Alex Schubert
ERP & Navision
Dolphin Communication Technologies GmbH
Otto-Hahnstr. 1 c
D-69190 Walldorf
Alex Schubert
ERP & Navision
Dolphin Communication Technologies GmbH
Otto-Hahnstr. 1 c
D-69190 Walldorf
0
Comments
-
I use the following code with no problems:
<PRE>
//xlApp Automation 'Microsoft Excel 8.0 Object Library'.Application
//xlBook Automation 'Microsoft Excel 8.0 Object Library'.Workbook
//xlSheet Automation 'Microsoft Excel 8.0 Object Library'.Worksheet
CLEAR(xlApp);
CLEAR(xlBook);
CLEAR(xlSheet);
CREATE(xlApp);
xlBook := xlApp.Workbooks.Add;
xlSheet := xlBook.Sheets().Add;
xlSheet.Name('Projekt Statistik');
xlSheet.Range('A1').Value := 'This is cell A1';
xlApp.Visible(TRUE);
CLEAR(xlApp);
CLEAR(xlBook);
CLEAR(xlSheet);
</PRE>No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Thanks, but i have the same Problem.
If i don't save the Excel sheet i get an Program
crash :-(
P.S.: But thanks anyway ...Best regards
Alex Schubert
ERP & Navision
Dolphin Communication Technologies GmbH
Otto-Hahnstr. 1 c
D-69190 Walldorf0 -
I had the same xl problem (XL 8.0): ERROR when I close XL before closing the report.
I was using only CLEAR(xlAPP), but when code as Luc:
CLEAR(xlAPP)
CLEAR(xlBook)
CLEAR(xlSheet)
everything is OK,
10x Luc <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />0 -
Just remember where you saw the answer ;-)No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Thanks i works, if i use the CLEAR Funktion
befor and after the Code !!!
Thanks AlexBest regards
Alex Schubert
ERP & Navision
Dolphin Communication Technologies GmbH
Otto-Hahnstr. 1 c
D-69190 Walldorf0
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