+ Reply to Thread
Results 1 to 9 of 9

Saving to a network drive macro...

  1. #1
    Registered User
    Join Date
    01-25-2010
    Location
    Enlgand
    MS-Off Ver
    Excel 1997
    Posts
    5

    Saving to a network drive macro...

    Hi guys,

    I currently have the following code:
    Please Login or Register  to view this content.
    This works fine in that it takes the value in A1, uses it as a file name and saves it to the folder on the S drive.

    However, I have a problem. The S drive is a network drive and not everyone in the company has it mapped to the letter S. Therefore I think I want to use some code like this at the start so that it doesn't matter what letter people have the drive mapped to:

    ChDrive "\\network1\shared$\"
    ChDir \\network1\shared$\Folder\

    I can't get it to work though! Does Chdrive have to just be a letter? If so, how on earth can I get this to work?

    I hope that's clear and many thanks for any help at all!!

    Cheers,

    David.
    Last edited by DaveNP; 01-28-2010 at 08:26 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Saving to a network drive macro...

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Code tags added this time
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    01-25-2010
    Location
    Enlgand
    MS-Off Ver
    Excel 1997
    Posts
    5

    Re: Saving to a network drive macro...

    Sorry about that.

    Does anyone have any idea? I'm on quite a tight deadline..

    Thanks,

    David.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Saving to a network drive macro...

    Maybe like this:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    01-25-2010
    Location
    Enlgand
    MS-Off Ver
    Excel 1997
    Posts
    5

    Re: Saving to a network drive macro...

    Many thanks for the reply, however if I copy and paste your code in, it gets stuck here:

    Please Login or Register  to view this content.
    And (highlighting the sFile) says 'named argument not found'

    I'm usually not too bad a being able to look at code and understand what's going on, however I'm really not sure I understand what has been done here :P

    Do I need to change this code in some way for it to work on my spreadsheet? Where in the code does it say to save it to S:\folder?

    Thanks again for the help so far!

    David.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Saving to a network drive macro...

    Oops.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-25-2010
    Location
    Enlgand
    MS-Off Ver
    Excel 1997
    Posts
    5

    Re: Saving to a network drive macro...

    Ah great, the code now works.

    How do I tell it that I want it to save in the location "s:\folder"? Where do I put that? At the moment it comes up with a save box with the file name as cell A1, but it doesn't take it automatically to the correct directory.

    Thanks!

    David

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Saving to a network drive macro...

    Look at the arguments to GetSaveAsFilename in Help.

  9. #9
    Registered User
    Join Date
    01-25-2010
    Location
    Enlgand
    MS-Off Ver
    Excel 1997
    Posts
    5

    Re: Saving to a network drive macro...

    Lovely, I think I have it working fine now

    Many thanks for all the help!!!!

    David

+ 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