+ Reply to Thread
Results 1 to 3 of 3

Saving a Workbook With A Specific File Name in a Specific Location

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Not here, it's rubbish!
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    66

    Saving a Workbook With A Specific File Name in a Specific Location

    Hi,

    As a total newbie to VBA, I'm hoping someone can point me in the right direction. My problem is simple (see attached file), I need to assign a macro to a button that saves the workbook with a specific filename at a specific location within the Windows 7 OS.

    So the file I've uploaded has two cells specifying the file location to be saved (B2) and the file name to be used (B3). My macro code is is assigned to Button 2 and its code is:-
    Please Login or Register  to view this content.
    but when I click Button 2 I get an error message (which also pasted into the file)

    Can any one help solve this?

    Many thanks
    Attached Files Attached Files
    Last edited by alansidman; 11-06-2016 at 11:00 AM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,971

    Re: Saving a Workbook With A Specific File Name in a Specific Location

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    273

    Re: Saving a Workbook With A Specific File Name in a Specific Location

    Are you sure the path exits and that the path ends in "\" before adding the filename? Run your macro and put a break at the .save as line and show what the total path+filename is.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Saving specific Sheet as CSV in the current location of the workbook
    By saif87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2016, 07:00 AM
  2. [SOLVED] Macro to manually choose PDF file and save it to a specific location with specific name
    By tnuis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2014, 07:47 AM
  3. Call a specific workbook from a file location and move worksheet to different workbook
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2014, 01:46 AM
  4. saving to a specific file as workbook is update
    By superchew in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-09-2013, 06:22 AM
  5. Replies: 0
    Last Post: 07-11-2013, 02:08 AM
  6. [SOLVED] Saving file in a date specific location
    By mayurpatil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2013, 01:30 AM
  7. VBA for saving a file to a specific location
    By TimT in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-07-2005, 04:05 PM

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