Excel Automation - Create Workbook problem NAV4.0

michaelmmichaelm 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

Comments

  • garakgarak Member Posts: 3,263
    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)

    Regards
    Do you make it right, it works too!
  • DenSterDenSter Member Posts: 8,304
    michaelm wrote:
    comes up with an error HResult blah blah bleh !
    Wow I've never seen an error message that unclear :mrgreen:

    Please post the actual error message
  • krikikriki Member, Moderator Posts: 9,110
    [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!


  • michaelmmichaelm Member Posts: 20
    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 ?
  • KTA8KTA8 Member Posts: 397
    In which method do you have your code?
  • michaelmmichaelm Member Posts: 20
    KTA8 wrote:
    In which method do you have your code?


    Sorry please explain.

    I am not a programmer just a super user who made a report. I am in Nav 4.0 using C/Side
  • KTA8KTA8 Member Posts: 397
    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
  • michaelmmichaelm Member Posts: 20
    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.
  • KTA8KTA8 Member Posts: 397
    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 solution
Sign In or Register to comment.