Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Print to PDF using PDF-XChange 3.0

Hi all,

I'm looking for a way to print a Excel sheet into a PDF formatted
file.
the used PDF printer is "PDF-XChange 3.0"
Due to company policy, i don't know for sure if i can use other
software than the one already installed.

I use now following code:

Sub CopyToNewSheet()
'
Sheets("Foutdetectie").Select
Sheets("Foutdetectie").Copy After:=Sheets(2)
Sheets("Foutdetectie (2)").Select
Range("A1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"PDF-XChange 3.0 on Ne00:", printtofile:=True,
prtofilename:=FileName
Application.DisplayAlerts = False
Sheets("Foutdetectie (2)").Select
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
Sheets("Foutdetectie").Select
Range("A1").Select
End Sub

the problems (2) i encounter are as follow:
When i invoke the following code,

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"PDF-XChange 3.0 on Ne00:", printtofile:=True,
prtofilename:=FileName

a "Save As" form appears, and i have to enter the filename manually.
I would like to have it all done by the macro.
FileName is a variable getting its info from a function witch work.
There's also a checkbox " Run Viewer Application After Saving' active,
witch i need to checked out.

When i delete the copy of the orriginal sheet, i get an error
message : "Can't enter break mode at this time"

Anyone who can help me with this?
Regards,
ludo


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Print to PDF using PDF-XChange 3.0

Have you tried turning off alerts before printing?

Application.DisplayAlerts = False
Print something
Application.DisplayAlerts = True

Mike F
"Ludo" wrote in message
...
Hi all,

I'm looking for a way to print a Excel sheet into a PDF formatted
file.
the used PDF printer is "PDF-XChange 3.0"
Due to company policy, i don't know for sure if i can use other
software than the one already installed.

I use now following code:

Sub CopyToNewSheet()
'
Sheets("Foutdetectie").Select
Sheets("Foutdetectie").Copy After:=Sheets(2)
Sheets("Foutdetectie (2)").Select
Range("A1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"PDF-XChange 3.0 on Ne00:", printtofile:=True,
prtofilename:=FileName
Application.DisplayAlerts = False
Sheets("Foutdetectie (2)").Select
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
Sheets("Foutdetectie").Select
Range("A1").Select
End Sub

the problems (2) i encounter are as follow:
When i invoke the following code,

ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"PDF-XChange 3.0 on Ne00:", printtofile:=True,
prtofilename:=FileName

a "Save As" form appears, and i have to enter the filename manually.
I would like to have it all done by the macro.
FileName is a variable getting its info from a function witch work.
There's also a checkbox " Run Viewer Application After Saving' active,
witch i need to checked out.

When i delete the copy of the orriginal sheet, i get an error
message : "Can't enter break mode at this time"

Anyone who can help me with this?
Regards,
ludo




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Print to PDF using PDF-XChange 3.0

On 1 sep, 15:17, "Mike Fogleman" wrote:
Have you tried turning off alerts before printing?

Application.DisplayAlerts = False
Print something
Application.DisplayAlerts = True

Mike F"Ludo" wrote in message

...


Yes,i did, but no luck.
In the mean time, i installed the free PDFCreator (http://
sourceforge.net/projects/pdfcreator/) in combination with some code
from the Excelguru.CA site (http://www.excelguru.ca/node/21), and this
works pretty good.
Don't forget to select the PDFCreator library in the VBA references!

Just a little problem with a public variable who gets reset after
running my code.
Perhaps the problem is due to the fact i renamed the modules (instead
of "module1", "module2", its now "CreatePDF", "Main", ...) and the
public variable doesn't reside in the right module.
At opening of the Excel file, i run a macro (workbook_open) to define
the path where i would like to place the PDF files (on a server).
Then i fill-out a excel sheet, and press on a button to create the PDF
file and save it on the server.
This works fine, but my variable holding the path is empty when my
code exits the CreatePDF subroutine.
Have to check this.

Regards,
Ludo

Hi all,


I'm looking for a way to print a Excel sheet into a PDF formatted
file.
the used PDF printer is "PDF-XChange 3.0"
Due to company policy, i don't know for sure if i can use other
software than the one already installed.


I use now following code:


Sub CopyToNewSheet()
'
* *Sheets("Foutdetectie").Select
* *Sheets("Foutdetectie").Copy After:=Sheets(2)
* *Sheets("Foutdetectie (2)").Select
* *Range("A1").Select
* *ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
* * * *"PDF-XChange 3.0 on Ne00:", printtofile:=True,
prtofilename:=FileName
* * Application.DisplayAlerts = False
* *Sheets("Foutdetectie (2)").Select
* *ActiveWindow.SelectedSheets.Delete
* *Application.DisplayAlerts = True
* *Sheets("Foutdetectie").Select
* *Range("A1").Select
End Sub


the problems (2) i encounter are as follow:
When i invoke the following code,


* *ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
* * * *"PDF-XChange 3.0 on Ne00:", printtofile:=True,
prtofilename:=FileName


a "Save As" form appears, and i have to enter *the filename manually.
I would like to have it all done by the macro.
FileName is a variable getting its info from a function witch work.
There's also a checkbox " Run Viewer Application After Saving' active,
witch i need to checked out.


When i delete the copy of the orriginal sheet, i get an error
message : "Can't enter break mode at this time"


Anyone who can help me with this?
Regards,
ludo- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -


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
Print and Print Preview Graphic Moving Resizing 2007/2003 Adam Rayburn Excel Discussion (Misc queries) 0 April 4th 07 04:18 PM
Macro to hide rows with a certain cell empty then set print area and print tahrah Excel Programming 12 January 9th 07 03:47 AM
cell borders that I create dont show on print preview or print scott3435 Excel Discussion (Misc queries) 2 April 6th 06 02:37 AM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook will Excel Programming 3 September 23rd 04 08:05 PM


All times are GMT +1. The time now is 08:09 AM.

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

About Us

"It's about Microsoft Excel"