Sunday 15 April 2012

excel - Converting postscript file to pdf not working -



excel - Converting postscript file to pdf not working -

update: sample of excel info i'm trying pdf , pdf file created below excel - http://i.imgur.com/lne1ver.jpg pdf - http://i.imgur.com/yndhfmv.jpg

the problem seems process isn't detecting content in worksheet - advice on how can 'activate' content?

-

i have vba macro converts excel study pdf files - want replicate code across several workbooks when works in workbook , not others.

the code below - update 4 const values in each relevant cell / value each workbook , i've checked same references selected in each workbook.

when run code loops through, changing index cell , produces pdf new data. in 1 of workbooks though pdfs not beingness created, have stepped through code , creates postscript file not convert pdf.

public sub exportgraphs() const indexcell = "b55" const totalcell = "d55" const authorityname = "b5" const filename = "civic cultural , community venues performance indicator standings study 2013-14 - " application.screenupdating = false application.showwindowsintaskbar = false application.displayalerts = false application.enableevents = false dim integer dim awb workbook set awb = thisworkbook dim mypdf pdfdistiller set mypdf = new pdfdistiller = 1 awb.worksheets("pin").range(totalcell).value awb.worksheets("pin").range(indexcell).value = dim strgraphloc, strpin string strpin = awb.sheets("pin").range(authorityname).value & " " & awb.worksheets("pin").range("b6").value strgraphloc = awb.path & "/" dim psfilename string dim pdffilename string psfilename = strgraphloc & filename & strpin & ".ps" pdffilename = strgraphloc & filename & strpin & ".pdf" 'print excel range postscript file awb.sheets("pin").printout copies:=1, from:=1, preview:=false, activeprinter:="acrobat distiller", printtofile:=true, collate:=true, prtofilename:=psfilename 'convert postscript file .pdf mypdf.filetopdf psfilename, pdffilename, "" kill psfilename kill strgraphloc & filename & strpin & ".log" next set mypdf = nil application.displayalerts = true application.screenupdating = true application.showwindowsintaskbar = true application.enableevents = true end sub

any help appreciated, can't life of me work out why works in , not others.

in workbook having problem with, 0kb postscript file created , text file states:

%%[ warning: empty job. no pdf file produced. ] %%

to start obvious: 0-byte postscript language file contains no graphics, distiller cannot convert meaningful pdf file. so, why postscript language file 0 bytes long?

something failing printing problem spreadsheet.

take vba out of problem. seek printing problem spreadsheet via excel "print" menu item. print postscript , non-postscript printers. suspect fail also.

diagnose printing failure. 1 time "print" menu item works, suspect vba script also.

excel vba pdf postscript

No comments:

Post a Comment