+ Reply to Thread
Results 1 to 4 of 4

"Save as" Macro to Network share

  1. #1
    Registered User
    Join Date
    02-18-2004
    Posts
    55

    "Save as" Macro to Network share

    Wanted to see if I could get some assistance. I'm trying to create a Macro that will Save my worksheet to a network share as a Macro Enabled worksheet with a file name based on the contents of Cell Value C5.

    I'm relatively new to VB so be easy...I've searched around a little but can't really find what I'm looking for. Any ideas. I was originally trying to work with the below code, but keep getting compile errors.
    Please Login or Register  to view this content.
    Last edited by pjw23; 06-09-2011 at 12:01 AM.

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: "Save as" Macro to Network share

    hi pjw23 and welcome to the forum. Please take a moment or two to read the forum rules located here. Specifically, read rule #3 and use code tags around your code. Thanks.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: "Save as" Macro to Network share

    Thanks! A couple of things to start with.
    1. Does the value in C5 have an extension like .xls or xlsx?The following code assumes that it does not have an extension.
    Please Login or Register  to view this content.
    This code declares Sheet 1 as the sheet to use for the C5 value. If it differs from yours, change it accordingly. Also, notice the filename after wb.SaveAs, you have to declare the drive (in my case it is G:\) and then also notice the "&" that is used twice. Depending on your version, you have to declare the proper extension. If your version is 2003, us .xls. I am using 2010 so that is why I used .xlsm

    Regards:
    Last edited by Mordred; 06-09-2011 at 12:17 AM.

  4. #4
    Registered User
    Join Date
    02-18-2004
    Posts
    55

    Re: "Save as" Macro to Network share

    Mordred,

    THANK YOU!!! THANK YOU!!! THANK YOU!!!

    Exactly what I was looking for.....Very Cool!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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