Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
The following code is extracted from a larger routine which purpor is to print/convert an xls into a pdf. sFileFullname = Mid(strFilename, InStrRev(strFilename, "\") + 1, 255) 'get full filename sFileName = Left(sFileFullname, Len(sFileFullname) - 4) 'File Name sExtension = Right(sFileFullname, 3) 'File Extension sPath = Left(strFilename, InStrRev(strFilename, "\")) 'get path PSFileName = sPath & sFileName & ".ps" PDFFileName = sPath & sFileName & ".pdf" Set objApp = CreateObject("Excel.Application") With objApp Application.Cursor = xlWait .Visible = True Set sSheet = Workbooks.Open(Sheets("parameters").Range("A250")) End With Dim MySheet As Worksheet Set MySheet = ActiveSheet 'Select the PDF printer MsgBox "Please select your Acrobat Printer from the available list of printers", , "Which printer is your PDF Printer?" bPrntSel = Application.Dialogs(xlDialogPrinterSetup).Show ' Application.Visible = False 'Create the PostScript File If bPrntSel Then MySheet.PrintOut ActivePrinter:=ActivePrinter, PrintToFile:=True, PrToFileName:=PSFileName '...continues on It works beautifully in Excel 2000, but always generate a 1004 error in 2003 at the MySheet.PrintOut ..... line (Your file could not be printed due to an error on ...: There are several possible reasons (not enough memory, network printer etc€¦))?! Any advice would be greatly appreciated. Thank you, QB |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sort works in 2003 but not in 2000 | Excel Programming | |||
Object works in Excel 2000 but not in 2003 | Excel Programming | |||
external data works in 2003 not in 2000 | Excel Programming | |||
VB Code works in 2000, but not 2003 | Excel Programming | |||
Why 'Unprotect' works for 2003 but not 2000?! | Excel Programming |