Excel Automation - Create Workbook problem NAV4.0

michaelm
Member Posts: 20
Hi
I have created a report which takes a quotation and places line data into excel and also excel formulas. This is so that the end excel file is a functioning calculator if you want to say change the quantity or line discount. As well as this it looks at the default vendor and obtains the latest purchase price in currency. I can also maniplute the currency exchange rate in the excel fiel to see the effects of a different rates, effects on gross and net margins etc etc.
Ok so that the boring bit. What I don't understand is in the UK works perfectly. Yet when I load it into my sister companies data base in France or in the Netherlands. The workbook will not create, but comes up with an error HResult blah blah bleh !
The following is the code for creating the workbook
ExcelBuf.OpenBook(ExcelFileName, 'Data');
ExcelBuf.CreateSheet('Data','MMGB',COMPANYNAME,USERID);
ExcelBuf.GiveUserControl;
Does anyone have any ideas?
thanks in advance
Michael
I have created a report which takes a quotation and places line data into excel and also excel formulas. This is so that the end excel file is a functioning calculator if you want to say change the quantity or line discount. As well as this it looks at the default vendor and obtains the latest purchase price in currency. I can also maniplute the currency exchange rate in the excel fiel to see the effects of a different rates, effects on gross and net margins etc etc.
Ok so that the boring bit. What I don't understand is in the UK works perfectly. Yet when I load it into my sister companies data base in France or in the Netherlands. The workbook will not create, but comes up with an error HResult blah blah bleh !
The following is the code for creating the workbook
ExcelBuf.OpenBook(ExcelFileName, 'Data');
ExcelBuf.CreateSheet('Data','MMGB',COMPANYNAME,USERID);
ExcelBuf.GiveUserControl;
Does anyone have any ideas?
thanks in advance
Michael
0
Comments
-
what for an excel version is on the clients of your sister companies :?:
Could you also copy the whole error messace (Press Ctrl+C go to the forum or notepad and press there ctrl+V)
RegardsDo you make it right, it works too!0 -
michaelm wrote:comes up with an error HResult blah blah bleh !
Please post the actual error message0 -
[Topic moved from 'NAV Tips & Tricks' forum to 'NAV/Navision' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Sorry for the delay, here is the message........
This message is for C/AL programmers:
An exception was raised in method value. The OLE control or Automation server has returned error (HRESULT) - 2147352567.
This component did not provide the exception description.
I checked to see if the decimal . to , was causing an issue but could not see anything wrong on that side.
Any ideas out there ?0 -
In which method do you have your code?0
-
That's strange I think this error happend to me.
It could be:-
1. COMDLG32.OCX error, Other countries systems don't have it.
2. A problem with decimal character in UK and USA are different from Europe
3. ExcelBuf.OpenBook(ExcelFileName, 'Data'); try to ExcelBuf.CreateBook instead
0 -
KTA8 wrote:That's strange I think this error happend to me.
It could be:-
1. COMDLG32.OCX error, Other countries systems don't have it.
2. A problem with decimal character in UK and USA are different from Europe
3. ExcelBuf.OpenBook(ExcelFileName, 'Data'); try to ExcelBuf.CreateBook instead
thanks for the reply.
1. Not sure how this affects what is happening. However just a thought I am running office 2007 in 2003 compatability mode ! Could this be why ?
2. When I run it in the other system it converts the decimal "." to"," on the request form, so hopefully ok there.
3. If I do this I lose all my template work in Excel so not a good solution really.0 -
michaelm wrote:
thanks for the reply.
1. Not sure how this affects what is happening. However just a thought I am running office 2007 in 2003 compatability mode ! Could this be why ?
2. When I run it in the other system it converts the decimal "." to"," on the request form, so hopefully ok there.
3. If I do this I lose all my template work in Excel so not a good solution really.
1. It could be, I don't remember which Excel API takes Excel Buffer. But I suppose that is compatible with some Office versions. But first I will try to register that ocx in one PC at prove. It's harder to find out the compatibitly modes
3. I say that only like a idea to try, not as a final solution0
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