Hi all,
I've been searching for ages trying to work out how to do this but have so far only managed to confuse myself.
I have office 2007 and I have found some code to convert an excel sheet to PDF, however I need it to saveas the contents of cell (e6) and save to a location on our network drives (C:\TEMP\).
Your help will be most appreciated.Code:Sub Macro1() ' ' Macro1 Macro ' ' Keyboard Shortcut: Ctrl+Shift+L ' Sheets(Array("Report")).Select Sheets("Report").Activate ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "C:\TEMP\Book1.pdf", Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ True End Sub
Last edited by Jabba; 10-15-2009 at 07:06 AM. Reason: SOLVED
Hi,
Try this:
Code:ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "C:\temp\" & Range("E6").Value, Quality:=xlQualityStandard, IncludeDocProperties:=True, _ IgnorePrintAreas:=False, OpenAfterPublish:=True
Sarcasm - because beating the **** out of someone is illegal.
Thanks Dave, that worked perfectly.
Sub pdfsave()
pdfname = Range("P4").Value
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=pdfname, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
End Sub
I am looking for a macro to saved to a specific folder on my computer as a PDF file (c:\My Documents/PDF) and automatically named based on cell content. Excel 2007
This coding below works, but I want to add that it automatically saves to a specific folder on my computer.
Is it possible to save to PDF and .xls in the same macro?
Sub pdfsave()
pdfname = Range("P4").Value
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=pdfname, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks