+ Reply to Thread
Results 1 to 2 of 2

Two copies being saved and unwanted save as box

Hybrid View

  1. #1
    Registered User
    Join Date
    08-27-2008
    Location
    UK
    Posts
    11

    Two copies being saved and unwanted save as box

    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)


    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
    Hopefully someone will be able to point me in the right direction.
    Last edited by Mark Brown; 03-04-2009 at 07:55 AM.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Two copies being saved and unwanted save as box

    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

    On posted correctly
    your VBA code will
    appear in its own 
    scrollable window
    within your message
    Forum Rules
    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 assisted or failed to assist you I welcome your Feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1