Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Paul Watkins
 
Posts: n/a
Default Excel to PDF conversion in VB

Hi
I have an excel sheet which i would like to convert to pdf via vb automatic
code.

What i want to do is click a button - run a macro that would convert the
sheet to PDF.
I recorded a macro when doing this manually, but when i run the code i
cannot get passed the save as dialog box.

Is there any code to do this?


Thanks in advance


Paul


  #2   Report Post  
Bill Martin -- (Remove NOSPAM from address)
 
Posts: n/a
Default

Paul Watkins wrote:
Hi
I have an excel sheet which i would like to convert to pdf via vb automatic
code.

What i want to do is click a button - run a macro that would convert the
sheet to PDF.
I recorded a macro when doing this manually, but when i run the code i
cannot get passed the save as dialog box.

Is there any code to do this?


Thanks in advance


Paul


------------------------------

I'm not sure what you want to do, but what I have done is to install
PDF995. It's a free program on the web that acts like a printer driver.
You tell Excel (or any other program) to print what you want, and then
select PDF995 as the printer to send it to and it creates a PDF file
that's an image of what you selected to print.

Bill
  #3   Report Post  
Paul Watkins
 
Posts: n/a
Default

Sorry i was not clear.

I have PDF995 installed, what i want to do is the automate this process via
VB code.
without having to fill in the save as dialog box.

Paul


"Bill Martin -- (Remove NOSPAM from address)"
wrote in message ...
Paul Watkins wrote:
Hi
I have an excel sheet which i would like to convert to pdf via vb
automatic code.

What i want to do is click a button - run a macro that would convert the
sheet to PDF.
I recorded a macro when doing this manually, but when i run the code i
cannot get passed the save as dialog box.

Is there any code to do this?


Thanks in advance


Paul

------------------------------

I'm not sure what you want to do, but what I have done is to install
PDF995. It's a free program on the web that acts like a printer driver.
You tell Excel (or any other program) to print what you want, and then
select PDF995 as the printer to send it to and it creates a PDF file
that's an image of what you selected to print.

Bill



  #4   Report Post  
Bill Martin -- (Remove NOSPAM from address)
 
Posts: n/a
Default

Paul Watkins wrote:
Sorry i was not clear.

I have PDF995 installed, what i want to do is the automate this process via
VB code.
without having to fill in the save as dialog box.

Paul


Sorry, but I wouldn't know how to do that. It seems that you want to
run VB from Excel to control part of the OS. That's probably entirely
doable, but not by *me* <g.

Bill
  #5   Report Post  
Darcy
 
Posts: n/a
Default

Hi Paul,

I'm going through a similar dilema myself. I've created a macro that does
pretty much what you're talking about, but the created file is either empty
(0 KB) or corrupted and won't open using Adobe. !?!?! Ugh.
This is some of the VB I used:

Application.ActivePrinter = "Adobe PDF on Ne00:"


For CoNo = 7 To 400
AppStr = "LoadCompany_" & CoNo
CellRefA = "A" & CoNo
CellRefB = "B" & CoNo
CoName = Range(CellRefB).Value
XStr = UCase(Range(CellRefA).Value)

If XStr = "X" Then
Application.Run AppStr
Sheets("SUMMARY").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True,
PrToFileName:="C:\Documents and Settings\marusichd\Desktop\Email Worksheets\"
& CoName & ".pdf"
Sheets("FLEET").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True,
PrToFileName:="C:\Documents and Settings\marusichd\Desktop\Email Worksheets\"
& CoName & "2.pdf"
Sheets("SELECT TO PRINT").Select

End If

Next CoNo

If you try this with PDF995 and find it works, let me know. I'm using Excel
XP and Adobe Acrobat 6.0

Thanx,
Darcy :o)

"Bill Martin -- (Remove NOSPAM from addre" wrote:

Paul Watkins wrote:
Sorry i was not clear.

I have PDF995 installed, what i want to do is the automate this process via
VB code.
without having to fill in the save as dialog box.

Paul


Sorry, but I wouldn't know how to do that. It seems that you want to
run VB from Excel to control part of the OS. That's probably entirely
doable, but not by *me* <g.

Bill

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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
conversion of MS Works Spreadsheet to Excel 2002 Spreadsheet Kellie Excel Discussion (Misc queries) 1 March 24th 05 06:31 PM
I get a program error when I download an excel template Ladybug Excel Discussion (Misc queries) 3 March 4th 05 12:02 AM
Excel Time Conversion Stan Excel Discussion (Misc queries) 4 January 25th 05 11:29 PM
Difference in number of Excel NewsGroups Hari Prasadh Excel Discussion (Misc queries) 1 January 25th 05 11:32 AM


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