Error on Creating an Excel Workbook from Navision

navgirl980
Member Posts: 17
Hello everybody,
I am getting the following error on using excel automation. I am trying to save an excel workbook onto a location.
"The call to member SaveAs failed.Microsoft Office Excel returned the following message:
SaveAs method of Workbook class failed."
Does anyone have any idea how to resolve it? :?:
I am getting the following error on using excel automation. I am trying to save an excel workbook onto a location.
"The call to member SaveAs failed.Microsoft Office Excel returned the following message:
SaveAs method of Workbook class failed."
Does anyone have any idea how to resolve it? :?:
0
Comments
-
Do you use Workbooks.Add or Workbook.Open?
Code example:
C/AL Globals (of your MS-Excel Library):Name DataType Subtype Excel Automation 'Microsoft Excel 12.0 Object Library'.Application Book Automation 'Microsoft Excel 12.0 Object Library'.Workbook Sheet Automation 'Microsoft Excel 12.0 Object Library'.Worksheet
Create(Excel); Book:=Excel.Workbooks.Add; Sheet:=Book.Worksheets.Item('Sheet1'); Sheet.Activate; Sheet.Range('A1').Value:='test'; Book.SaveAs('C:\test.xlsx'); // or an other path Book.Close; Excel.Quit; CLEAR(Excel);
kind regards,
winfy0 -
Dear Winfy,
Thanks for ur reply.
I tried ur code but am having the same error.
Can you advise
Thanks0 -
Anyone help please0
-
You need to search this topic on forum(Dynamicusers also) i have seen somewhere else about this topic.0
-
I think you should check your path.... This is because you do not have write permission to the specified folder..0
-
U were rite imclever1205.
In fact,it was not just about the permission issue.If you have a specified a name with invalid characters will give you the same error.
Thnks0 -
Try this ..
XlWrkBk.SaveAs(FilePath+'\'+FileName,-4143);
XlWrkBk.Close;0
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