LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel 11.0 object library Help

Hi

 

Im using CVI 2009 and trying to open a workbook using the Excel 11.0 object library.

 

This is what i got so far:

Excel_NewApp (NULL, 1, LOCALE_NEUTRAL, 0,&ExcelStruct.AppHandle);
Excel_WorkbooksOpen (ExcelStruct.AppHandle, NULL, Mapping.ExcelFilePath, CA_DEFAULT_VAL,
                              CA_DEFAULT_VAL, CA_DEFAULT_VAL,
                              CA_DEFAULT_VAL, CA_DEFAULT_VAL,
                              CA_DEFAULT_VAL, CA_DEFAULT_VAL,
                              CA_DEFAULT_VAL, CA_DEFAULT_VAL,
                              CA_DEFAULT_VAL, CA_DEFAULT_VAL,
                              CA_DEFAULT_VAL, CA_DEFAULT_VAL,
                              CA_DEFAULT_VAL, &ExcelStruct.WorkBookHandle);

	// Get First Sheet
Excel_WorkbookGetWorksheets (ExcelStruct.WorkBookHandle, NULL,&ExcelSheetsHandle);
Excel_SheetsGetItem (ExcelStruct.AppHandle, NULL, CA_VariantInt(1),&ExcelStruct.WorkSheetHandle);

I keep on getting an Unknown error when trying to open a workbook.

Im i doing this correct?

Help share your knowlegde
0 Kudos
Message 1 of 3
(2,759 Views)

I suggest you read this old post from Chris Matthews which explains some detail on the function.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(2,755 Views)

Thanks that helped.

But what im really trying to do is copy a sheet from one workbook and add it to a different workbook.

Do you perhaps know how to do this or point me in the right direction?

Help share your knowlegde
0 Kudos
Message 3 of 3
(2,750 Views)