General information
Category:
Reports & Report designer
Title:
Invalid Path or File Name when running report
I am getting an interminttent error when I run a report and save it to a file. Most of the time the code executes OK but sometimes generates the error, '202 Invalid path or file name' on the line, "Report form (lcReportName) To File (lcPS) Noconsole Next 1"
Here is the whole form method:
Lparameters lcReportName, lcPDFFileName, llNext1
Local lcPDF, lcPS
lcPDF = Addbs(Justpath(lcPDFFileName)) + Juststem(lcPDFFileName) + ".pdf"
lcPS = Addbs(Justpath(lcPDFFileName)) + Juststem(lcPDFFileName) + ".ps"
Set Printer To Name 'Adobe PDF'
If llNext1
Report Form (lcReportName) To File (lcPS) Noconsole Next 1
Else
Report Form (lcReportName) To File (lcPS) Noconsole
Endif
Set Printer To Default
If File(lcPS)
loDist = Createobject("pdfDistiller.PDFDistiller.1")
lnResult = loDist.FileToPDF(lcPS,lcPDF,"")
Endif
I am using Adobe Acrobat 8. I have put in a wait window to check the path/filename string and it is always correct. Are there any gotcha's with this type of command? Any suggestions on other ways to do the same thing?
Thanks very much,
Stan
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only