Excel Automation Problem

Hohenstein
Member Posts: 6
Hello,
I have a problem with Excel Automation.
I've tried to design a report which exports some items to an excel-file.
If i try to compile my Report, following Message occurs:
"The variable XLAPPLICATION::WORKBOOKPIVOTTA is defined more than once."
"An example could be: 'File' exists as both a data type and a global variable."
And a second problem:
Does anyone know how I can fill data to a different sheet?
I hope that someone could help me!
I have a problem with Excel Automation.
I've tried to design a report which exports some items to an excel-file.
If i try to compile my Report, following Message occurs:
"The variable XLAPPLICATION::WORKBOOKPIVOTTA is defined more than once."
"An example could be: 'File' exists as both a data type and a global variable."
And a second problem:
Does anyone know how I can fill data to a different sheet?
I hope that someone could help me!
0
Comments
-
Resize the name of your Navision variable for the automation.
LaExcelRange ==> LaEx0 -
Hi
You will have to add the worksheets at the start of your report and then if you are grouping by a specific field add the following code to get to the next sheet in the OnPresection of GroupFooter
data for footer in formation to fill current worksheet
Sheet := Sheet.Next; // Gets the next worksheet
Sheet.Activate;
to add lets say 4 worksheets do the following in the Report - OnPreReport
CLEAR(App);
CREATE(App);
App.Visible(FALSE);
Book := App.Workbooks.Add(-4167);
FOR x := 1 TO 3 DO
Book.Worksheets.Add;
Sheet := App.ActiveSheet;
Sheet.Name := 'A';
FOR x := 1 TO 3 DO BEGIN
Sheet := Sheet.Next;
CASE x OF
1 : Sheet.Name := 'B';
2 : Sheet.Name := 'C';
3 : Sheet.Name := 'D';
END;
END;
FOR x := 4 DOWNTO 1 DO
Sheet := Sheet.Previous;
Sheet.Activate;
Hope this helps0 -
Hi,
first thanks for your suggestion.
But i already have the problem with the error Message:
"The variable APP::NEWWORKBOOK is defined more than once."
"An example could be: 'File' exists as both a data type and a global variable."
Hope you can help me!0 -
Export the object to text and search for the duplicate name0
-
Thanks, now it works!!!0
-
Glad I could help \:D/0
-
:? How do I do to pass in the same work book from a sheet to another?
Thanks0
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