printing excel file
-
Can anyone please tell me how to use _Worksheet::PrintOut() method to print excel file. I tried to set the printArea and print the excel file out as follow;
_Worksheet sheet; //common OLE variants. Easy variants to use for calling arguments. COleVariant covTrue((short)TRUE),covFalse((short)FALSE),covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR); //get the excel file name //open the file // print it out now PageSetup pg = sheet.GetPageSetup(); pg.SetPrintArea("$A$!:$H$25;$A$45:$H$60;$J$80:$Z$100"); sheet.PrintOut(covOptional, covOptional, covOptional, covOptional, covOptional, covOptional, covOptional, covOptional);
the nothing got printed.. Am I using PrintOut in wrong way?? Thank You -
Can anyone please tell me how to use _Worksheet::PrintOut() method to print excel file. I tried to set the printArea and print the excel file out as follow;
_Worksheet sheet; //common OLE variants. Easy variants to use for calling arguments. COleVariant covTrue((short)TRUE),covFalse((short)FALSE),covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR); //get the excel file name //open the file // print it out now PageSetup pg = sheet.GetPageSetup(); pg.SetPrintArea("$A$!:$H$25;$A$45:$H$60;$J$80:$Z$100"); sheet.PrintOut(covOptional, covOptional, covOptional, covOptional, covOptional, covOptional, covOptional, covOptional);
the nothing got printed.. Am I using PrintOut in wrong way?? Thank YouTry using the sheet.GetPageSetup() function. It will give you the Page Setup object and you can use SetPrintArea() from there. I also had trouble getting SetPrintArea() to work from the sheet itself. Hope this helps... *********************** Tony Fontenot Recreational Solutions tony@recsolutions.com ***********************