+ Reply to Thread
Results 1 to 4 of 4

Macro - Set 'GetOpenFileName' to default NETWORK location

  1. #1
    Registered User
    Join Date
    09-30-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    85

    Macro - Set 'GetOpenFileName' to default NETWORK location

    Morning,

    I have the following code below that prompts a user to select a file from the active workbook drive and directory. However, when the active workbook is placed on a network drive, runtime error '5' comes up. Or alternatively, if Chdrive/Chdir is removed, the code can be run, but the default location for the user prompt is set to where the last open file location was. Id like the default user prompt directory to either be the current directory of where this workbook is placed on the network, or specified in the code as '//network/share' as this location does not change.

    Can anyone help with this? Thanks in advance!

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    Re: Macro - Set 'GetOpenFileName' to default NETWORK location

    ChDrive and chDir cannot be used for network paths.

    You can either map the path to a drive and access it that way, or you have to create a function to pull it.

  3. #3
    Registered User
    Join Date
    09-30-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    85

    Re: Macro - Set 'GetOpenFileName' to default NETWORK location

    How can I create a function to pull it exactly? Thanks for the help!

  4. #4
    Registered User
    Join Date
    08-13-2015
    Location
    usa
    MS-Off Ver
    2010
    Posts
    17

    Re: Macro - Set 'GetOpenFileName' to default NETWORK location

    Does anyone can help with this problem ?

    Thank you ,
    Rb

+ 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. Default GetOpenFilename location
    By hoffey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-10-2009, 07:17 PM
  2. Change GetOpenFilename Default Location
    By Tirren in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-29-2008, 10:14 PM
  3. [SOLVED] Macro - Need location of XLS itself to be set as default
    By CRayF in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-23-2005, 09:05 AM
  4. Specify Start Location for GetOpenFileName box
    By WCR in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2005, 02:05 PM
  5. GetOpenFilename file location
    By del167 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-10-2005, 11:52 AM

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