Automating the Creation of PDF Files 
Author Message
 Automating the Creation of PDF Files

I have been using the following code to print pdf files
from an Excel spreadsheet. It works without bringing up
the dialogue box for naming the file and location to save
it to on my laptop running Windows 2000 Pro. However, the
dialogue box still pops up when I try to run the code on a
Windows 98 computer. Why?

ActiveWindow.SelectedSheets.PrintOut From:=1,
To:=NoOfSheets.Value, Copies:=NoOfCopies.Value, Collate _
        :=True, printtofile:=True,
PrToFileName:=savePDFTo.Value & "\labsummary",
ActivePrinter:="Acrobat PDFWriter"
    Sheets("Charts").Select
    ActiveWindow.SelectedSheets.PrintOut From:=1, To:=2,
Copies:=NoOfCopies.Value, Collate _
        :=True, printtofile:=True,
PrToFileName:=savePDFTo.Value & "\labcharts",
ActivePrinter:="Acrobat PDFWriter"
    Sheets("Moisture").Select

Mike Hoar



Sat, 26 Jun 2004 20:54:44 GMT  
 Automating the Creation of PDF Files
Mike,

Do you have two different versions of Adobe. I know my version 4.0 requires
are registry setting to be set in order to eliminate the dialog box. If this
is the case, continue the thread and I will post a sample of the code.

HTH,

Justin


Quote:
> I have been using the following code to print pdf files
> from an Excel spreadsheet. It works without bringing up
> the dialogue box for naming the file and location to save
> it to on my laptop running Windows 2000 Pro. However, the
> dialogue box still pops up when I try to run the code on a
> Windows 98 computer. Why?

> ActiveWindow.SelectedSheets.PrintOut From:=1,
> To:=NoOfSheets.Value, Copies:=NoOfCopies.Value, Collate _
>         :=True, printtofile:=True,
> PrToFileName:=savePDFTo.Value & "\labsummary",
> ActivePrinter:="Acrobat PDFWriter"
>     Sheets("Charts").Select
>     ActiveWindow.SelectedSheets.PrintOut From:=1, To:=2,
> Copies:=NoOfCopies.Value, Collate _
>         :=True, printtofile:=True,
> PrToFileName:=savePDFTo.Value & "\labcharts",
> ActivePrinter:="Acrobat PDFWriter"
>     Sheets("Moisture").Select

> Mike Hoar



Sat, 26 Jun 2004 21:30:44 GMT  
 Automating the Creation of PDF Files
Mike,

My only suggestion would be to make sure that you're using qualified
references. See the following:

Q189618 PRB: Automation Error Calling Unqualified Method or Property
http://support.microsoft.com/support/kb/articles/q189/6/18.asp

HTH,
Gerard

Microsoft Office Development with Visual Studio
http://msdn.microsoft.com/library/en-us/dnoffdev/html/vsofficedev.asp

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.
--------------------
| Content-Class: urn:content-classes:message


| Subject: Automating the Creation of PDF Files
| Date: Tue, 8 Jan 2002 04:54:44 -0800
| Lines: 22

| MIME-Version: 1.0
| Content-Type: text/plain;
|       charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
| Thread-Index: AcGYQ6T3842TzYw9Ty+cBiGN8Z7jmg==
| Newsgroups: microsoft.public.office.developer.vba
| Path: cpmsftngxa09
| Xref: cpmsftngxa09 microsoft.public.office.developer.vba:8210
| NNTP-Posting-Host: TKMSFTNGXA14 10.201.226.42
| X-Tomcat-NG: microsoft.public.office.developer.vba
|
| I have been using the following code to print pdf files
| from an Excel spreadsheet. It works without bringing up
| the dialogue box for naming the file and location to save
| it to on my laptop running Windows 2000 Pro. However, the
| dialogue box still pops up when I try to run the code on a
| Windows 98 computer. Why?
|
|
| ActiveWindow.SelectedSheets.PrintOut From:=1,
| To:=NoOfSheets.Value, Copies:=NoOfCopies.Value, Collate _
|         :=True, printtofile:=True,
| PrToFileName:=savePDFTo.Value & "\labsummary",
| ActivePrinter:="Acrobat PDFWriter"
|     Sheets("Charts").Select
|     ActiveWindow.SelectedSheets.PrintOut From:=1, To:=2,
| Copies:=NoOfCopies.Value, Collate _
|         :=True, printtofile:=True,
| PrToFileName:=savePDFTo.Value & "\labcharts",
| ActivePrinter:="Acrobat PDFWriter"
|     Sheets("Moisture").Select
|
| Mike Hoar
|



Sun, 04 Jul 2004 04:05:13 GMT  
 Automating the Creation of PDF Files
Yes I have version 4, please post a sample of the code.

Many thanks for the offer of help. I only hope that I am
not too late responding!!!

Mike Hoar

Quote:
>-----Original Message-----
>Mike,

>Do you have two different versions of Adobe. I know my

version 4.0 requires
Quote:
>are registry setting to be set in order to eliminate the
dialog box. If this
>is the case, continue the thread and I will post a sample
of the code.

>HTH,

>Justin


message

>> I have been using the following code to print pdf files
>> from an Excel spreadsheet. It works without bringing up
>> the dialogue box for naming the file and location to
save
>> it to on my laptop running Windows 2000 Pro. However,
the
>> dialogue box still pops up when I try to run the code
on a
>> Windows 98 computer. Why?

>> ActiveWindow.SelectedSheets.PrintOut From:=1,
>> To:=NoOfSheets.Value, Copies:=NoOfCopies.Value, Collate
_
>>         :=True, printtofile:=True,
>> PrToFileName:=savePDFTo.Value & "\labsummary",
>> ActivePrinter:="Acrobat PDFWriter"
>>     Sheets("Charts").Select
>>     ActiveWindow.SelectedSheets.PrintOut From:=1, To:=2,
>> Copies:=NoOfCopies.Value, Collate _
>>         :=True, printtofile:=True,
>> PrToFileName:=savePDFTo.Value & "\labcharts",
>> ActivePrinter:="Acrobat PDFWriter"
>>     Sheets("Moisture").Select

>> Mike Hoar

>.



Wed, 21 Jul 2004 21:18:02 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Automate Report Output to PDF files

2. Automating Reports Print to File in PDF format

3. Automate Printing as PDF Files using VBA

4. Automating the printing of PDF files

5. Need Help with PDF Batch Creation

6. PDF Creation from VB

7. Dynamic PDF Creation

8. after pdf Export with Crystal - pdf File isn't able to use default Font

9. not allowing viewers to print PDF and also to protect PDF files with password

10. ANN: PDF Creation tools with SVG Support

11. Automated export to PDF

12. Automating Adobe Acrobat, (creating pdf's)

 

 
Powered by phpBB® Forum Software