Hi,
I have my exe that makes a file excel...
then I save this file and export to pdf...
this exe is on a server and Windows Task scheduler run this exe every night (02.00).
when I run this exe by my double click mouse that works fine but when it run by Windows Task scheduler I get this error:
Application
===========
Path and name: C:\batchDcasta\LAVCEN.EXE (64 bits)
Size: 5,244,928 bytes
Compiler version: Harbour 3.2.0dev (r1904111533)
FiveWin version: FWH 19.06
C compiler version: Microsoft Visual C++ 19.20.27508 (64-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 25 secs
Error occurred at: 05-07-2023, 06:00:35
Error description: (DOS Error -2147352567) WINOLE/1006 Unable to set the PaperSize property for the PageSetup class. (0x800A03EC): Microsoft Excel
Args:
[ 1] = N 9
Stack Calls
===========
Called from: => TOLEAUTO:_PAPERSIZE( 0 )
Called from: lavcen.prg => MAIN( 657 )
any solution?
thanks
I have my exe that makes a file excel...
oExcel := CREATEOBJECT( "Excel.Application" )
oBook := oExcel:Workbooks()Â
oWorkBook := oExcel:Workbooks:Add()
oWorkBook:Sheets("Foglio1"):Select()Â Â
oWorkBook:Sheets("Foglio1"):Name := "Dati"
...oExcel:WorkSheets(1):PageSetup:PrintTitleRows := "$1:$2"
oExcel:WorkSheets(1):PageSetup:CenterFooter := "Pagina &P di &N"Â Â
oExcel:WorkSheets(1):PageSetup:Orientation := 2
oExcel:WorkSheets(1):PageSetup:PaperSize := 9Â Â Â Â Â Â
oExcel:WorkSheets(1):PageSetup:Zoom := .f.      Â
oExcel:WorkSheets(1):PageSetup:FitToPagesWide := 1Â
oExcel:WorkSheets(1):PageSetup:FitToPagesTall := .f.   Â
oExcel:WorkSheets(1):ExportAsFixedFormat( xlTypePDF,cFilePDF)Â Â Â Â
oWorkBook:SaveAs(Filename:=cFileMail, FileFormat:=52)when I run this exe by my double click mouse that works fine but when it run by Windows Task scheduler I get this error:
Application
===========
Path and name: C:\batchDcasta\LAVCEN.EXE (64 bits)
Size: 5,244,928 bytes
Compiler version: Harbour 3.2.0dev (r1904111533)
FiveWin version: FWH 19.06
C compiler version: Microsoft Visual C++ 19.20.27508 (64-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 25 secs
Error occurred at: 05-07-2023, 06:00:35
Error description: (DOS Error -2147352567) WINOLE/1006 Unable to set the PaperSize property for the PageSetup class. (0x800A03EC): Microsoft Excel
Args:
[ 1] = N 9
Stack Calls
===========
Called from: => TOLEAUTO:_PAPERSIZE( 0 )
Called from: lavcen.prg => MAIN( 657 )
any solution?
thanks
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)