C
chemburkar
Hi,
I have a program which copies excel file to postscript .ps file.
The code works fine for small number of files.
But if I try to run it for 5,000-6,000 excel files the programs fail
throwing 1004 error.
I am guessing that it could be run time memory problem.
Could somebody suggest me solution for this?
code snippet
=========================================
ReportFileName = ReportsPath & ReportFile
Application.Workbooks.Open (ReportFileName)
PortName = Space(255)
PortName = NTS(PortName) 'NTS is function which returns por
name
'create the distiller printer name.
printer = "Acrobat Distiller on " & PortName '
strMenuFilePS = Replace(ReportFile, ".xls", ".ps")
strMenuFilePS = "E:\Test\" & strMenuFilePS
Application.ActiveWindow.SelectedSheets.PrintOu
ActivePrinter:=printer, PrintToFile:=True, PrToFileName:=strMenuFilePS
Application.ActiveWorkbook.Close
ReportFile = ""
ReportFile = Dir ' Get next entry.
==============================================
Thanks in advance
Meghan
I have a program which copies excel file to postscript .ps file.
The code works fine for small number of files.
But if I try to run it for 5,000-6,000 excel files the programs fail
throwing 1004 error.
I am guessing that it could be run time memory problem.
Could somebody suggest me solution for this?
code snippet
=========================================
ReportFileName = ReportsPath & ReportFile
Application.Workbooks.Open (ReportFileName)
PortName = Space(255)
PortName = NTS(PortName) 'NTS is function which returns por
name
'create the distiller printer name.
printer = "Acrobat Distiller on " & PortName '
strMenuFilePS = Replace(ReportFile, ".xls", ".ps")
strMenuFilePS = "E:\Test\" & strMenuFilePS
Application.ActiveWindow.SelectedSheets.PrintOu
ActivePrinter:=printer, PrintToFile:=True, PrToFileName:=strMenuFilePS
Application.ActiveWorkbook.Close
ReportFile = ""
ReportFile = Dir ' Get next entry.
==============================================
Thanks in advance
Meghan