Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PS to PDF Problems

I've a bit of a problem. I have a routine that creates excel worksheet
then converts them into .PS files, and then into .PDF.

It works fine converting them into .PS files, but it keeps giving m
this error whenever it tries to convert the .PS into a .PDF:

Run-time error '-2147417851 (80010105)':

Method 'FileToPDF' of object 'IPdfDistiller' failed

I've got it to run before last quarter, but now this keeps happening.
can get one spreadsheet to work no problem, it's when the second shee
tries to run that the problem occurs.

Any ideas?

Thanks in Advance.

The shortened code is below:

Private Sub AEDoCommission()

Dim Quarter As String
Dim Year As Integer
Dim x As String
Dim Report As Workbook
Dim myName As String
Dim mycount As Integer
Dim copycount As Integer
Dim mynumber As Integer
Dim myRegion As String
Dim PSFileName As String
Dim PDFFileName As String
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller


myName
Workbooks("AE_Statement.xls").Sheets("Statement"). Range("Name").Value
myRegion
Workbooks("AE_Statement.xls").Sheets("Statement"). Range("Region").Value
Quarter = Sheets("Statement").Range("Quarter").Value
Year = Sheets("Statement").Range("Year").Value
x = "NA Corp Commissions" & " " & Year & " " & Quarter & " "
"Hardcode"
j = x & ".xls"
g = "G:\Business Ops\James\Commission Summary\"
h = g & Quarter & " " & Year & "\" & x & ".xls"
i = Quarter & " " & Year
k = "TCVs-" & Quarter
t = Workbooks(j).Sheets("Ind Sum").Range("t").Value
s = Workbooks(j).Sheets("Ind Sum").Range("s").Value
PSFileName = "G:\Business Ops\James\Commission Summary\" & i
"\Statements\" & myRegion & "\" & myName & ".ps"
PDFFileName = "G:\Business Ops\James\Commission Summary\" & i
"\Statements\" & myRegion & "\" & myName & ".pdf"

Application.ScreenUpdating = True

ActiveWorkbook.SaveAs Filename:= _
"G:\Business Ops\James\Commission Summary\" & i
"\Statements\" & myRegion & "\" & myName & ".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Workbooks("TCV.xls").Save
Workbooks("TCV.xls").Close

'Application.DisplayAlerts = False
'Application.ActivePrinter = "Acrobat PDFWriter on LPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat PDFWriter", printtofile:=True, prtofilename:=PSFileName

myPDF.FileToPDF PSFileName, PDFFileName, ""

ActiveWorkbook.Clos

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
aauugghhh...#div/o problems & various average formula problems acbel40 Excel Worksheet Functions 5 October 19th 09 05:00 PM
Fix Your Problems!!! Derrick Excel Discussion (Misc queries) 4 July 31st 09 08:06 PM
Problems Kay Excel Worksheet Functions 7 May 26th 09 10:47 PM
Problems Kay Excel Worksheet Functions 2 May 22nd 09 02:37 AM
XLA problems Neil Bhandar[_2_] Excel Programming 1 January 15th 04 04:53 AM


All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"