Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default Is it possible......?

Hi ,
I have a macro and at the end I create a pdf file using the following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", 16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to save the file and
with what name .... my question is is it possible to save the file in pdf
with a certain name in a certain folder witout being asked .

What I have to change in my code to save the pdf file "test.pdf" in
c:\Index ?

thanks
Ana


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Is it possible......?

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", 16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True, PrintToFile:=True, _
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file using the following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", 16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to save the file and
with what name .... my question is is it possible to save the file in pdf
with a certain name in a certain folder witout being asked .

What I have to change in my code to save the pdf file "test.pdf" in
c:\Index ?

thanks
Ana


  #3   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default Is it possible......?

Hi
Like that I can create Test.pdf but I can not open it , it says that the
file is not correct :o(


"Tom Ogilvy" wrote:

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", 16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True, PrintToFile:=True, _
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file using the following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", 16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to save the file and
with what name .... my question is is it possible to save the file in pdf
with a certain name in a certain folder witout being asked .

What I have to change in my code to save the pdf file "test.pdf" in
c:\Index ?

thanks
Ana


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Is it possible......?

Ana,
From what I understand (but I may be wrong...):
Printing to file gives you a .ps file not a .pdf, despite the fact that you
have given it a .pdf extension. The resulting file can be processed by
Distiller to give a real .pdf file.
You can see this by opening the apparent .pdf in a text editor and comparing
it to a "real" .pdf file.

The easiest way is to by pass this and create a .pdf directly, so forget the
printToFile and filename
The name of the workbook will be used for the file name and the destination
folder will be dependent on the port, as shown in the PrintersAdobe
PDFPropertiesPorts. You can add another port if you want another location.

There are other settings in the pdf print driver that may interfere with
this, one being "Prompt for Adobe PDF filename" which you need to uncheck.

NickHK

"Ana" wrote in message
...
Hi
Like that I can create Test.pdf but I can not open it , it says that the
file is not correct :o(


"Tom Ogilvy" wrote:

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",

16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True, PrintToFile:=True,

_
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file using the following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",

16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to save the file

and
with what name .... my question is is it possible to save the file in

pdf
with a certain name in a certain folder witout being asked .

What I have to change in my code to save the pdf file "test.pdf" in
c:\Index ?

thanks
Ana




  #5   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default Is it possible......?

and how I creat a pdf file from the code without using PrintToFile

"NickHK" wrote:

Ana,
From what I understand (but I may be wrong...):
Printing to file gives you a .ps file not a .pdf, despite the fact that you
have given it a .pdf extension. The resulting file can be processed by
Distiller to give a real .pdf file.
You can see this by opening the apparent .pdf in a text editor and comparing
it to a "real" .pdf file.

The easiest way is to by pass this and create a .pdf directly, so forget the
printToFile and filename
The name of the workbook will be used for the file name and the destination
folder will be dependent on the port, as shown in the PrintersAdobe
PDFPropertiesPorts. You can add another port if you want another location.

There are other settings in the pdf print driver that may interfere with
this, one being "Prompt for Adobe PDF filename" which you need to uncheck.

NickHK

"Ana" wrote in message
...
Hi
Like that I can create Test.pdf but I can not open it , it says that the
file is not correct :o(


"Tom Ogilvy" wrote:

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",

16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True, PrintToFile:=True,

_
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file using the following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",

16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to save the file

and
with what name .... my question is is it possible to save the file in

pdf
with a certain name in a certain folder witout being asked .

What I have to change in my code to save the pdf file "test.pdf" in
c:\Index ?

thanks
Ana







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Is it possible......?

Ana,
Just delete those 2 arguments:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= "Acrobat
Distiller sur RPT1:"

NickHK

"Ana" wrote in message
...
and how I creat a pdf file from the code without using PrintToFile

"NickHK" wrote:

Ana,
From what I understand (but I may be wrong...):
Printing to file gives you a .ps file not a .pdf, despite the fact that

you
have given it a .pdf extension. The resulting file can be processed by
Distiller to give a real .pdf file.
You can see this by opening the apparent .pdf in a text editor and

comparing
it to a "real" .pdf file.

The easiest way is to by pass this and create a .pdf directly, so forget

the
printToFile and filename
The name of the workbook will be used for the file name and the

destination
folder will be dependent on the port, as shown in the PrintersAdobe
PDFPropertiesPorts. You can add another port if you want another

location.

There are other settings in the pdf print driver that may interfere with
this, one being "Prompt for Adobe PDF filename" which you need to

uncheck.

NickHK

"Ana" wrote in message
...
Hi
Like that I can create Test.pdf but I can not open it , it says that

the
file is not correct :o(


"Tom Ogilvy" wrote:

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",

16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:=

_
"Acrobat Distiller sur RPT1:", Collate:=True,

PrintToFile:=True,
_
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file using the

following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",

16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,

ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to save the

file
and
with what name .... my question is is it possible to save the file

in
pdf
with a certain name in a certain folder witout being asked .

What I have to change in my code to save the pdf file "test.pdf"

in
c:\Index ?

thanks
Ana







  #7   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default Is it possible......?

I do not undestand if I delete those arguments I have nothing in my code ??


"NickHK" wrote:

Ana,
Just delete those 2 arguments:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= "Acrobat
Distiller sur RPT1:"

NickHK

"Ana" wrote in message
...
and how I creat a pdf file from the code without using PrintToFile

"NickHK" wrote:

Ana,
From what I understand (but I may be wrong...):
Printing to file gives you a .ps file not a .pdf, despite the fact that

you
have given it a .pdf extension. The resulting file can be processed by
Distiller to give a real .pdf file.
You can see this by opening the apparent .pdf in a text editor and

comparing
it to a "real" .pdf file.

The easiest way is to by pass this and create a .pdf directly, so forget

the
printToFile and filename
The name of the workbook will be used for the file name and the

destination
folder will be dependent on the port, as shown in the PrintersAdobe
PDFPropertiesPorts. You can add another port if you want another

location.

There are other settings in the pdf print driver that may interfere with
this, one being "Prompt for Adobe PDF filename" which you need to

uncheck.

NickHK

"Ana" wrote in message
...
Hi
Like that I can create Test.pdf but I can not open it , it says that

the
file is not correct :o(


"Tom Ogilvy" wrote:

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:=

_
"Acrobat Distiller sur RPT1:", Collate:=True,

PrintToFile:=True,
_
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file using the

following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,

ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to save the

file
and
with what name .... my question is is it possible to save the file

in
pdf
with a certain name in a certain folder witout being asked .

What I have to change in my code to save the pdf file "test.pdf"

in
c:\Index ?

thanks
Ana








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Is it possible......?

Ana,
Did you try the code ?

NickHK

"Ana" wrote in message
...
I do not undestand if I delete those arguments I have nothing in my code

??


"NickHK" wrote:

Ana,
Just delete those 2 arguments:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= "Acrobat
Distiller sur RPT1:"

NickHK

"Ana" wrote in message
...
and how I creat a pdf file from the code without using PrintToFile

"NickHK" wrote:

Ana,
From what I understand (but I may be wrong...):
Printing to file gives you a .ps file not a .pdf, despite the fact

that
you
have given it a .pdf extension. The resulting file can be processed

by
Distiller to give a real .pdf file.
You can see this by opening the apparent .pdf in a text editor and

comparing
it to a "real" .pdf file.

The easiest way is to by pass this and create a .pdf directly, so

forget
the
printToFile and filename
The name of the workbook will be used for the file name and the

destination
folder will be dependent on the port, as shown in the PrintersAdobe
PDFPropertiesPorts. You can add another port if you want another

location.

There are other settings in the pdf print driver that may interfere

with
this, one being "Prompt for Adobe PDF filename" which you need to

uncheck.

NickHK

"Ana" wrote in message
...
Hi
Like that I can create Test.pdf but I can not open it , it says

that
the
file is not correct :o(


"Tom Ogilvy" wrote:

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,

ActivePrinter:=
_
"Acrobat Distiller sur RPT1:", Collate:=True,

PrintToFile:=True,
_
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file using the

following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9",

"10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,

ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to save

the
file
and
with what name .... my question is is it possible to save the

file
in
pdf
with a certain name in a certain folder witout being asked .

What I have to change in my code to save the pdf file

"test.pdf"
in
c:\Index ?

thanks
Ana










  #9   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default Is it possible......?

you mean only PrToFileName:="C:\Test.PDF" ?

I have an error

"NickHK" wrote:

Ana,
Did you try the code ?

NickHK

"Ana" wrote in message
...
I do not undestand if I delete those arguments I have nothing in my code

??


"NickHK" wrote:

Ana,
Just delete those 2 arguments:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= "Acrobat
Distiller sur RPT1:"

NickHK

"Ana" wrote in message
...
and how I creat a pdf file from the code without using PrintToFile

"NickHK" wrote:

Ana,
From what I understand (but I may be wrong...):
Printing to file gives you a .ps file not a .pdf, despite the fact

that
you
have given it a .pdf extension. The resulting file can be processed

by
Distiller to give a real .pdf file.
You can see this by opening the apparent .pdf in a text editor and
comparing
it to a "real" .pdf file.

The easiest way is to by pass this and create a .pdf directly, so

forget
the
printToFile and filename
The name of the workbook will be used for the file name and the
destination
folder will be dependent on the port, as shown in the PrintersAdobe
PDFPropertiesPorts. You can add another port if you want another
location.

There are other settings in the pdf print driver that may interfere

with
this, one being "Prompt for Adobe PDF filename" which you need to
uncheck.

NickHK

"Ana" wrote in message
...
Hi
Like that I can create Test.pdf but I can not open it , it says

that
the
file is not correct :o(


"Tom Ogilvy" wrote:

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,

ActivePrinter:=
_
"Acrobat Distiller sur RPT1:", Collate:=True,
PrintToFile:=True,
_
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file using the
following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9",

"10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to save

the
file
and
with what name .... my question is is it possible to save the

file
in
pdf
with a certain name in a certain folder witout being asked .

What I have to change in my code to save the pdf file

"test.pdf"
in
c:\Index ?

thanks
Ana











  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Is it possible......?

Ana,
No, use the code I posted:

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= "Acrobat
Distiller sur RPT1:"

NickHK

"Ana" wrote in message
...
you mean only PrToFileName:="C:\Test.PDF" ?

I have an error

"NickHK" wrote:

Ana,
Did you try the code ?

NickHK

"Ana" wrote in message
...
I do not undestand if I delete those arguments I have nothing in my

code
??


"NickHK" wrote:

Ana,
Just delete those 2 arguments:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:=

"Acrobat
Distiller sur RPT1:"

NickHK

"Ana" wrote in message
...
and how I creat a pdf file from the code without using PrintToFile

"NickHK" wrote:

Ana,
From what I understand (but I may be wrong...):
Printing to file gives you a .ps file not a .pdf, despite the

fact
that
you
have given it a .pdf extension. The resulting file can be

processed
by
Distiller to give a real .pdf file.
You can see this by opening the apparent .pdf in a text editor

and
comparing
it to a "real" .pdf file.

The easiest way is to by pass this and create a .pdf directly,

so
forget
the
printToFile and filename
The name of the workbook will be used for the file name and the
destination
folder will be dependent on the port, as shown in the

PrintersAdobe
PDFPropertiesPorts. You can add another port if you want

another
location.

There are other settings in the pdf print driver that may

interfere
with
this, one being "Prompt for Adobe PDF filename" which you need

to
uncheck.

NickHK

"Ana" wrote in message
...
Hi
Like that I can create Test.pdf but I can not open it , it

says
that
the
file is not correct :o(


"Tom Ogilvy" wrote:

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9",

"10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur

RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,

ActivePrinter:=
_
"Acrobat Distiller sur RPT1:", Collate:=True,
PrintToFile:=True,
_
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file using

the
following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9",

"10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur

RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to

save
the
file
and
with what name .... my question is is it possible to save

the
file
in
pdf
with a certain name in a certain folder witout being asked

..

What I have to change in my code to save the pdf file

"test.pdf"
in
c:\Index ?

thanks
Ana















  #11   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default Is it possible......?

but it ask me the name and where I want to save the pdf file and that is what
I do not want .....and if I take out in the printer properties "promt for a
name " I do not where the file it is saved.
I need to be able to chosse the name and the folder for the pdf file

"NickHK" wrote:

Ana,
No, use the code I posted:

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= "Acrobat
Distiller sur RPT1:"

NickHK

"Ana" wrote in message
...
you mean only PrToFileName:="C:\Test.PDF" ?

I have an error

"NickHK" wrote:

Ana,
Did you try the code ?

NickHK

"Ana" wrote in message
...
I do not undestand if I delete those arguments I have nothing in my

code
??


"NickHK" wrote:

Ana,
Just delete those 2 arguments:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:=

"Acrobat
Distiller sur RPT1:"

NickHK

"Ana" wrote in message
...
and how I creat a pdf file from the code without using PrintToFile

"NickHK" wrote:

Ana,
From what I understand (but I may be wrong...):
Printing to file gives you a .ps file not a .pdf, despite the

fact
that
you
have given it a .pdf extension. The resulting file can be

processed
by
Distiller to give a real .pdf file.
You can see this by opening the apparent .pdf in a text editor

and
comparing
it to a "real" .pdf file.

The easiest way is to by pass this and create a .pdf directly,

so
forget
the
printToFile and filename
The name of the workbook will be used for the file name and the
destination
folder will be dependent on the port, as shown in the

PrintersAdobe
PDFPropertiesPorts. You can add another port if you want

another
location.

There are other settings in the pdf print driver that may

interfere
with
this, one being "Prompt for Adobe PDF filename" which you need

to
uncheck.

NickHK

"Ana" wrote in message
...
Hi
Like that I can create Test.pdf but I can not open it , it

says
that
the
file is not correct :o(


"Tom Ogilvy" wrote:

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9",

"10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur

RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
ActivePrinter:=
_
"Acrobat Distiller sur RPT1:", Collate:=True,
PrintToFile:=True,
_
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file using

the
following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9",
"10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur

RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to

save
the
file
and
with what name .... my question is is it possible to save

the
file
in
pdf
with a certain name in a certain folder witout being asked

..

What I have to change in my code to save the pdf file
"test.pdf"
in
c:\Index ?

thanks
Ana














  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Is it possible......?

Ana,
Like I said, it is saved to location determined by the Port setting, with
the filename the same as the name as the workbook.
From there you can move/copy it wherever you want.
So do you want to select the filename/location or not ?

Search this group for "Print to PDF through Acrobat 6.0" for other methods.

NickHK

"Ana" wrote in message
...
but it ask me the name and where I want to save the pdf file and that is

what
I do not want .....and if I take out in the printer properties "promt for

a
name " I do not where the file it is saved.
I need to be able to chosse the name and the folder for the pdf file

"NickHK" wrote:

Ana,
No, use the code I posted:

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= "Acrobat
Distiller sur RPT1:"

NickHK

"Ana" wrote in message
...
you mean only PrToFileName:="C:\Test.PDF" ?

I have an error

"NickHK" wrote:

Ana,
Did you try the code ?

NickHK

"Ana" wrote in message
...
I do not undestand if I delete those arguments I have nothing in

my
code
??


"NickHK" wrote:

Ana,
Just delete those 2 arguments:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:=

"Acrobat
Distiller sur RPT1:"

NickHK

"Ana" wrote in message
...
and how I creat a pdf file from the code without using

PrintToFile

"NickHK" wrote:

Ana,
From what I understand (but I may be wrong...):
Printing to file gives you a .ps file not a .pdf, despite

the
fact
that
you
have given it a .pdf extension. The resulting file can be

processed
by
Distiller to give a real .pdf file.
You can see this by opening the apparent .pdf in a text

editor
and
comparing
it to a "real" .pdf file.

The easiest way is to by pass this and create a .pdf

directly,
so
forget
the
printToFile and filename
The name of the workbook will be used for the file name and

the
destination
folder will be dependent on the port, as shown in the

PrintersAdobe
PDFPropertiesPorts. You can add another port if you want

another
location.

There are other settings in the pdf print driver that may

interfere
with
this, one being "Prompt for Adobe PDF filename" which you

need
to
uncheck.

NickHK

"Ana" wrote in message
...
Hi
Like that I can create Test.pdf but I can not open it , it

says
that
the
file is not correct :o(


"Tom Ogilvy" wrote:

have you tried

Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8",

"9",
"10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur

RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
ActivePrinter:=
_
"Acrobat Distiller sur RPT1:", Collate:=True,
PrintToFile:=True,
_
PrToFileName:="C:\Test.PDF"


--
Regards,
Tom Ogilvy

"Ana" wrote:

Hi ,
I have a macro and at the end I create a pdf file

using
the
following:
Sheets(Array("1", "2", "3", "4", "5", "6", "7", "8",

"9",
"10",
16" )).Select
Application.ActivePrinter = "Acrobat Distiller sur

RPT1:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1,
ActivePrinter:= _
"Acrobat Distiller sur RPT1:", Collate:=True

but like this I have to wait until I am asked where to

save
the
file
and
with what name .... my question is is it possible to

save
the
file
in
pdf
with a certain name in a certain folder witout being

asked
..

What I have to change in my code to save the pdf file
"test.pdf"
in
c:\Index ?

thanks
Ana
















  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Is it possible......?

I looked up what I did in an Access program to do something similar
using Acrobat 5. Later versions may be different. If this doesn't work,
I suggest searching the Adobe forums at www.adobeforums.com.

Add the registry key name PDFFileName to the "software\adobe\acrobat
pdfwriter\" key in the hkey_current_user hiererarchy. After each print
is completed, Acrobat should clear this entry and you will need to set
it before printing the next report.

Bill Simot

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



All times are GMT +1. The time now is 08:22 PM.

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"