[Migrated content. Thread originally posted on 31 March 2005]
I am trying to import data from a CSV file into an existing XLS file using Excel QueryTables. Everything works O.K. up until I call the Add method on the QueryTables. Then I get the error message:"Class is not licensed for use (error 800A03EC)"
What does this error mean?
Code snippet follows:
77 H-APP HANDLE OF @APPLICATION.
77 H-WORKBOOK HANDLE OF @WORKBOOK.
77 H-WORKSHEET HANDLE OF @WORKSHEET.
77 H-RANGE HANDLE OF @RANGE.
77 H-QUERYTABLE HANDLE OF @QUERYTABLE.
05 EXCEL-CSV-FILE-NAME PIC X(110) VALUE SPACES.
05 EXCEL-XLS-FILE-NAME PIC X(110) VALUE SPACES.
CREATE @Application OF @Excel HANDLE IN H-APP.
MODIFY H-APP Workbooks::Open(EXCEL-XLS-FILE-NAME)
GIVING H-WORKBOOK.
INQUIRE H-WORKBOOK @Worksheets::Item(1)
IN H-WORKSHEET.
* Get the next open cell to insert to
INQUIRE H-WORKSHEET Range("A65536")::End(xlUP)
IN H-RANGE.
INQUIRE H-RANGE @Offset(1,0) IN H-RANGE.
* Import the CSV data
*** This is the line generating the error ***
MODIFY H-WORKSHEET QueryTables::Add
(BY NAME @Connection EXCEL-CSV-FILE-NAME,
BY NAME @Destination H-RANGE)
GIVING H-QUERYTABLE.
.
.
.
TIA!
Kelli