ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   PDF output with Cell as filename (https://www.excelbanter.com/excel-worksheet-functions/33149-pdf-output-cell-filename.html)

Scott Zierler

PDF output with Cell as filename
 
Hello Everyone,

This has me pulling my hair out. I am trying to make a macro that will
select a range of cells, take a cell value and use it as the filename, then
use SendKeys to take that cell value and use it to avoid seeing the save as
dialog box. I am wishing to much here? CUrrently Errorsout and debugs at
the ActiveCell.Select line.

Thanks for your help!

Routing below.


Sub pdfout()
'
' pdfout Macro
' Macro recorded 6/29/2005 by Scott Zierler
'

'
Range("B1:F110").Select
Application.ActivePrinter = "Adobe PDF on Ne05:"
Selection.PrintOut Copies:=1, ActivePrinter:="Adobe PDF on Ne05:",
Collate _
:=True
ActiveCell.Select = ("$C$6")<<<ERRORS OUT HERE
Let PSFileName = Application.ActiveCell
SendKeys PSFileName & "{ENTER}", False
ActiveSheet.PrintOut , PrintToFile:=True
PSFileName = Chr(3) & PSFileName & Chr(34)

End Sub


Vasant Nanavati

Perhaps you want:

Range("C6").Select

(I haven't looked at the rest of the macro.)
--

Vasant

"Scott Zierler" <Scott wrote in message
...

ActiveCell.Select = ("$C$6")<<<ERRORS OUT HERE




Scott Zierler

Thanks for the suggestion. I probably should have been a little more clear
with my need here. I would like the macro to select a range to be printed to
a PDF file using an Active Cell content as the filename, then save to a PDF
without input from the user. I have no problem doing this to an HTM file
using the Publishobject routine, but too many email servers remove HTM
attachments.

Thanks Again.

"Vasant Nanavati" wrote:

Perhaps you want:

Range("C6").Select

(I haven't looked at the rest of the macro.)
--

Vasant

"Scott Zierler" <Scott wrote in message
...

ActiveCell.Select = ("$C$6")<<<ERRORS OUT HERE






All times are GMT +1. The time now is 04:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com