Hi,
I have created the following VBA code to save an excel report into PDF based on a cell name (customer number) and date.
The problems I have :-
1. I don't want to see the save as box when generating the PDF
2. It also saves the excel file as the name generated from the cell name and date (not required as I want to leave it as it's original name)
3. I need to save the document in the following directory (S:\Customer Level\Customer Report)
Hopefully someone will be able to point me in the right direction.Code:Sub saveasPDF() Dim fName As String fName = Range("e6").Value ActiveWorkbook.SaveAs Filename:=(fName) & Format(Date, "ddmmmyyyy") ActiveSheet.PrintOut copies:=1, ActivePrinter:="Adobe PDF" End Sub
Last edited by Mark Brown; 03-04-2009 at 07:55 AM.
Please take a couple of minutes and read ALL theForum Rules then wrap your VBA code (Rule 3)
The easiest way to use code tags is to click on the # icon in the text formatting window
This will add
[ Code] [\ Code]
to your message window with the cursor between the ][ brackets - this is were your VBA code goes.
You will not see your code displayed correctly until you preview or post your message
Note:- there is no space before the word Code like I have shown in the example above
Forum RulesCode:On posted correctly your VBA code will appear in its own scrollable window within your message
If you have any more questions about the rules etc please do not hesitate to contact a moderator
Please Read Forum Rules Before Posting
Wrap VBA code by selecting the code and clicking the # icon or Read This
How To Cross Post politely
Top Excel links for beginners to Experts
If you are pleased with a member's answer then use the Scales icon to rate it
If my reply has assistedor failed to assist you
I welcome your Feedback.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks