Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to print a excel worksheet to a pdf file. Here is the code:
Sub SaveAsPDF () ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _ "CutePDF Writer on CPW2:", PrintToFile:=True, Collate:=True, PrToFileName:="C:\WeeklyDTReport.pdf" End Sub Everything seems to be working correctly due to the fact that I do get the ..pdf file at the correct location with the correct name. The problem I have is when I go to open the file using Adobe Reader I get the following error: "Adobe Reader could not open 'WeeklyDTReport.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)." If I set PrintToFile = False and browse to the path and enter the name when prompted Adobe opens the file fine. What am I missing? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print Fit To Not Working | Excel Discussion (Misc queries) | |||
Disable print not working | Excel Programming | |||
Print Code not working | Excel Programming | |||
Printer.Print Not Working? | Excel Programming | |||
before print event not working | Excel Programming |