Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default print PDF file from Excel - NOT print Excel to PDF?

I have a column that has catalog items in it. My plan is to have the macro
read each catalog item and then print out a corresponding MSDS (material
data safety sheet) that is located on a server in a PDF format.

Is it possible to open the PDF file using VBA and print it? I would prefer
if this all took place unseen, maybe the only thing seen would be the print
dialog, to set number of copies.

Thanks for any help,

Alan Ibbotson


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default print PDF file from Excel - NOT print Excel to PDF?

Alan,
I'd use the API ShellExceute here. That way you can leave the OS to
decide which app should print the file. Not tested, but something like
this :

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA"
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As
String, ByVal lpParameters As String, ByVal lpDirectory As String,
ByVal nShowCmd As Long) As Long

Dim RetVal As Long
RetVal = ShellExecute(&O0, "print", Range("A1").Value, vbNullString,
ThisWorkbook.Path, &O0)

if retval<=32 then
msgbox "Couldn't print: See
http://www.allapi.net/apilist/ShellExecute.shtml"
else
'OK, continue
end if

NickHK

Alan Ibbotson wrote:
I have a column that has catalog items in it. My plan is to have the macro
read each catalog item and then print out a corresponding MSDS (material
data safety sheet) that is located on a server in a PDF format.

Is it possible to open the PDF file using VBA and print it? I would prefer
if this all took place unseen, maybe the only thing seen would be the print
dialog, to set number of copies.

Thanks for any help,

Alan Ibbotson


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
First page of Excel sheerepeats in print layout or print preview philfrotonda Excel Discussion (Misc queries) 1 July 12th 07 09:28 PM
my excel is converting all my print jobs to print to file why? Ginger Excel Discussion (Misc queries) 2 April 10th 07 12:28 PM
How to format the extension less file to print with Dos's Print Command Badshah Excel Discussion (Misc queries) 0 November 28th 06 12:44 PM
print and print preview not active in file drop down Bjorne Excel Discussion (Misc queries) 2 March 21st 06 06:36 AM
Why does macro speed slow after Excel Print or Print Preview? Larry A[_3_] Excel Programming 6 May 16th 05 11:22 AM


All times are GMT +1. The time now is 05:02 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"