CodePudding user response:
Give you a simple example:vExcelApp. OlePropertySet (" Visible ", true);
String xlsFile=L "D: \ \ ccrun \ \ 123. XLS";
VExcelApp. OlePropertyGet (" Workbooks "). OleFunction (" Open ", WideString (xlsFile));
Int Bounds [2]={0, 2};
The Variant sheetIndexs=VarArrayCreate (Bounds, 1, varInteger);
//select the first three Sheet
SheetIndexs. PutElement (1, 0);
SheetIndexs. PutElement (2, 1);
SheetIndexs. PutElement (3, 2);
The Variant vSheets=vExcelApp. OlePropertyGet (" Sheets ", sheetIndexs);
SafeArrayDestroyData (sheetIndexs parray);
VSheets. OleProcedure (" Select ");
CodePudding user response:
Thank demon elder brother, although look not to understand. But the code is available. But I use vSheets OleFunction (" PrintOut "); Print to PDF printer. Actually separated three PDF files. How do I can merge into a PDF file?CodePudding user response:
Use API method to print, is also a Sheet a file...CodePudding user response:
Behind the code on the 1st floor after me, and then add a line:vExcelApp. OlePropertyGet (" ActiveWindow "). OlePropertyGet (" SelectedSheets "). OleProcedure (" PrintOut ");
CodePudding user response: