"No printers are installed" printing from Excel via COM -
i have lotusscript code running in ibm domino 9.0 on 64-bit windows 2012 r2 server, uses com launch microsoft excel 2010, open workbook, print via pdfcreator (from pdfforge) convert workbook pdf.
ibm domino running service under system user, excel , pdfcreator run under user when started code.
this working fine until 2 days ago, pdfcreator started hanging on launch no reason i've determined.
one of admins customer reinstalled excel , pdfcreator, , deleted windows user profile (though don't know user). pdfcreator starting ok, there have been several issues excel.
i fixed excel issues changes code , os file system, problem when code tells excel print workbook, error occurs:
microsoft excel: no printers installed. install printer click file tab, , click print. click no printers installed, , click add printer. follow instructions in add printer dialog box.
this error occurs when trying print code.
can launch excel admin user , print manually, 3 printers (including pdfcreator) available in print dialogue-box.
it seems me printers not visible system user, have no idea how verify or fix this.
can it?
several bits of code follow. i've removed error handling , other things brevity.
the following code starts pdfcreator:
set pdfcreator=createobject("pdfcreator.clspdfcreator") if pdfcreator.cstart("/clearcache /noprocessingatstartup") pdfcreator.cclearcache pdfcreator.coption("printertemppath")=pdftmpdir pdfcreator.coption("useautosave")=1 pdfcreator.coption("useautosavedirectory")=1 pdfcreator.coption("autosavedirectory")=pdftmpdir pdfcreator.coption("autosaveformat")=0 pdfcreator.csaveoptions pdfcreator.cdefaultprinter="pdfcreator" end if
pdftmpdir
string variable containing directory path, set elsewhere in code.
these lines start excel:
set xlapp=createobject("excel.application") xlapp.visible=false
these lines open existing workbook , print it.
set xlbook=xlapp.workbooks.open(cebcmsheet) xlbook.printout ,,1,false,"pdfcreator"
cebcmsheet
string variable containing full path xls file, set elsewhere in code.
i've been able fix editing registry on windows server.
i found printers listed admin user in "devices" , "printerports" children of registry key:
hkey_users\s-1-5-19\software\microsoft\windows nt\currentversion
i copied keys ".default" user, , code runs no errors.
Comments
Post a Comment