"An unknown error has occurred" ID = -48
"An unknown error has occurred" ID = -48
- Subject: "An unknown error has occurred" ID = -48
- From: "Alatorre, Michael" <email@hidden>
- Date: Tue, 4 Dec 2001 16:22:08 -0800
I've scripted the creation of some Postscript file generation for later PDF
distillation using Excel & Word 2001, using the AdobePS 8.7.2 driver
(Virtual Printer). The problem that arises is that it will consistently
error ("An unknown error has occurred" ID = -48) in the Excel portion _if_
you haven't printed the worksheet once already. By that I mean you've gone
to through File...Print (or Cmd-P shortcut) menu dialog and generated a PS
file--if you do this for each worksheet, then run the script, it will
execute just fine. BTW, if you press Excel's printer icon shortcut, it'll
generate the same error (if you haven't done said workaround).
here is the script:
--------
-- change default Desktop Printer
set the DTP_name to "Virtual Printer"
tell application "Desktop Printer Manager"
set the default printer to desktop printer the DTP_name
end tell
-- Cleanup old HSD Postscript files
tell application "Finder"
if file "Data HD:HS Dashboard 1.ps" exists then
delete file "Data HD:HS Dashboard 1.ps"
end if
if file "Data HD:HS Dashboard 2.ps" exists then
delete file "Data HD:HS Dashboard 2.ps"
end if
if file "Data HD:HS Dashboard 3.ps" exists then
delete file "Data HD:HS Dashboard 3.ps"
end if
-- copy appending Postscript file to In folder for later distillation
if not (file "Data HD:In:hsd_full.ps" exists) then
copy file "Data HD:Combined PS:hsd_full.ps" to folder "Data HD:In:"
end if
end tell
-- Activate Excel and generate Postscript files for full report
tell application "Microsoft Excel"
Activate
Activate Window "HS Dashboard 1"
set Order of PageSetup of ActiveSheet to xlOverThenDown
Print SelectedSheets of ActiveWindow FromPage 1 ToPage 28 Copies 1
Activate Window "HS Dashboard 2"
set Order of PageSetup of ActiveSheet to xlOverThenDown
Print SelectedSheets of ActiveWindow FromPage 1 ToPage 25 Copies 1
end tell
-- Activate Word and generate Postscript file for full report
tell application "Microsoft Word"
activate
print window "HS Dashboard 3"
end tell
--------
I'm stumped. Has anyone seen this before? Any input greatly appreciated.
Thank you.
Michael Alatorre (
mailto:email@hidden)
EIS Liaison Analyst
Cedars-Sinai Health System (
http://www.cedars-sinai.edu/)
Medical Affairs: 310.423.6237 310.423.0448 (fax)
"If at first you don't succeed, transform your data set!" -- Brook's Law