+ Reply to Thread
Results 1 to 8 of 8

Save as macro with location and filename

  1. #1
    Forum Contributor
    Join Date
    07-14-2012
    Location
    Belgium/UK
    MS-Off Ver
    Excel 2003
    Posts
    111

    Save as macro with location and filename

    Hello,

    I am trying to save several sheets from 1 workbook as a separate wb in a specific location. The following code does that, but when I execute, it gives me a prompt saying "cannot save with these features...".
    It is trying to save as a macro-enabled workbook which I don't want. Sheet2-4 don't have any macro's in them. When I select to save without features, I get a run-time error. Removing the location results in the new wb being saved in the same location as the original file. Any help , greatly appreciated.


    Please Login or Register  to view this content.
    Last edited by realrookie; 12-20-2015 at 10:39 AM. Reason: additional info

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Save as macro with location and filename

    Try removing Filename:=......Just use Fname after &
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Contributor
    Join Date
    07-14-2012
    Location
    Belgium/UK
    MS-Off Ver
    Excel 2003
    Posts
    111

    Re: Save as macro with location and filename

    Thank you for your reply. Removing Filename:= results in the file being named Fname and still asking me to save as a macro enabled workbook. But no runtime error anymore

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Save as macro with location and filename

    Give this one a try..
    Please Login or Register  to view this content.
    Edit* If there is no value in Sheet1 D2, it will give a "Subscript out of range" error
    Last edited by gmr4evr1; 12-20-2015 at 11:46 AM. Reason: Added Edit*

  5. #5
    Forum Contributor
    Join Date
    07-14-2012
    Location
    Belgium/UK
    MS-Off Ver
    Excel 2003
    Posts
    111

    Re: Save as macro with location and filename

    Definitely better sir. Is there a way to surpress the macro-enabled saving message and auto select yes? Application.DisplayAlerts = False did not work,.

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Save as macro with location and filename

    That's odd, it works for me when I test it. I don't get the macro enabled saving message when I run it.

  7. #7
    Forum Contributor
    Join Date
    07-14-2012
    Location
    Belgium/UK
    MS-Off Ver
    Excel 2003
    Posts
    111

    Re: Save as macro with location and filename

    There is a macro within the sheet which I missed. Is there a way to suppress the message and auto accept yes?

  8. #8
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Save as macro with location and filename

    the Application.DisplayAlerts = False should do that. Not sure why it's not working for you but it is for me.

+ 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. Macro to Auto save a backup copy in a seperate location OR save file with a pop up
    By kdsanderson30 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-12-2014, 12:38 PM
  2. [SOLVED] macro to 'save as pdf' that prompts for filename, location AND only prints specified range
    By mtcolombo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2013, 01:49 PM
  3. [SOLVED] [Help]macro to open file browser, to select a location, and save the location to a cell
    By zhuleijia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2013, 09:56 AM
  4. [SOLVED] Macro to find filename from list in excel and return its location
    By puppythor in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 02-03-2013, 02:17 AM
  5. Macro with cell reference as a name, but prompt for save location and save as csv
    By tomham in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-15-2012, 06:21 PM
  6. macro to save sheet from workbook. Specified location and filename
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2011, 11:47 PM
  7. Run Macro on multiple files and save filename
    By anrivel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2011, 03:03 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