LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Excel vba printout method

Rats.

Curtis,

According to the pdf.xla (Acrobat 5.0) the .ini for winnt is in a winnt
subfolder SystemRoot$ + "\System32\Spool\Drivers\W32X86\"

It DOES NOT always have the name pdfwritr.ini. My XP sys uses the
"2\__pdf.ini"


If (bWinNT) Then
SystemRoot$ = GetPrivateProfileSetting(BaseKey:=HKEY_LOCAL_MACHI NE,
_
Section:="Software\Microsoft\Windows NT\CurrentVersion",
_
Setting:="SystemRoot")
iniFilename = SystemRoot$ + "\System32\Spool\Drivers\W32X86\"
If (bWinNT351) Then
iniFilename = iniFilename + "1\__pdf.ini"
Else
iniFilename = iniFilename + "2\__pdf.ini"
End If
Else
SystemRoot$ = GetPrivateProfileSetting(BaseKey:=HKEY_LOCAL_MACHI NE,
_
Section:="Software\Microsoft\Windows\CurrentVersio n", _
Setting:="SystemRoot")
iniFilename = SystemRoot$ + "\System\PDFWritr.ini"
End If



--

John

johnf202 at hotmail dot com


"Tom Ogilvy" wrote in message
...
Curtis previously stated:
I'm using excel 97 sr-2 on winnt 4.0

PrToFileName was not introduced until xl2000.

--
Regards,
Tom Ogilvy


jaf wrote in message
...
Hi Curtis,
PrToFileName is what your looking for.


Sub test()
Dim Output
Close
Output = "mytest.pdf"
Debug.Print Output
Sheets(1).Activate
Application.ActivePrinter = "Acrobat PDFWriter on LPT1:"
ActiveWindow.SelectedSheets.PrintOut _
Copies:=1, PrintToFile:=True, PrToFileName:="C:\Documents and
Settings\jaf\My Documents\mytest.pdf"

End Sub

--

John

johnf202 at hotmail dot com


"Curtis" wrote in message
om...
Hello all,

I've went throw all posts on vba excel printout codes and none worked.

I am using excel to create a file and i want to save it in pdf format
but dont want the popup that asks the filename to save under

here is the code that i'm using:

Application.ActivePrinter = "Adobe PDFWriter sur LPT1:"
ActiveWorkbook.SaveAs FileName:="C:\toto.xls"
ActiveWorkbook.PrintOut

I've tried specifying parameter of printout with no success

Help please
Curtis







 
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
Excel Printout becky57 New Users to Excel 3 February 4th 09 01:42 AM
Printout looks different than screen - Excel 2007 Celeste[_2_] Excel Discussion (Misc queries) 1 September 9th 08 12:41 AM
Please post this thread a correct full method, method about Nast Runsome New Users to Excel 8 February 25th 08 03:29 PM
Please post this thread a complete correct method, method about te Nast Runsome New Users to Excel 0 February 23rd 08 09:42 PM
my excel printout not straight helenakwek Excel Worksheet Functions 1 October 20th 06 01:50 PM


All times are GMT +1. The time now is 10:16 PM.

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

About Us

"It's about Microsoft Excel"