Automation error

DuhastDuhast Member Posts: 42
edited 2006-05-08 in Navision Attain
Hi!

I'm trying to execute following code :

VAR
xlChar = 'Microsoft Excel 9.0 Object Library'.Chart
xlRang = 'Microsoft Excel 9.0 Object Library'.Range

xlChart := xlBook.Charts.Add;
xlRang := xlSheet.Range('CL1:CL27');
xlChart.ChartWizard(xlRang,4,4,1,0,1,1,'Chart');

I have a runtime error, something about :

There is a problem calling Select member. Error at select method at range class

(Sorry, I must translate from Spanish)

The error is caused by 'Microsoft Excel 9.0 Object Library' (I tried also with 'Microsoft Excel 10.0 Object Library' and I have the same error) ?

Or what am I doing wrong?

Thanks

Comments

  • ara3nara3n Member Posts: 9,256
    The paramaters that you are passing to the excel are incorrect.

    xlRang := xlSheet.Range('CL1:CL27');

    change it to something like this

    xlRang := xlSheet.Range(xlSheet.Cells('CL1','CL27'));
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.