+ Reply to Thread
Results 1 to 2 of 2

VBA cannot open file

  1. #1
    Registered User
    Join Date
    02-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019 / MS365
    Posts
    55

    VBA cannot open file

    I have a text file which stores the next available invoice number for my Excel spreadsheet. It has worked for years, but when I try to make it more flexible (there are more users accessing this from different computers), I am running into a problem.

    Currently I have a button which I click to choose the path to the text document. This opens a file dialog box (msoFileDialogFilePicker). I have also included a custom function which will determine the UNC path, to accommodate different users on different computers. The problem occurs when the path that I choose is a mapped network drive to OneDrive. It seems to get stalled when it tries to open a file which contains “https://” in its path.

    The code that I am using looks something like this:
    Please Login or Register  to view this content.
    This OneDrive path works: \\COMPUTER_NAME\Users\USER_NAME\OneDrive\FILE_NAME.txt Of course, everything shown in capital letters is substituted here for the actual name.

    This mapped OneDrive path does NOT work: https://d.docs.live.net/SOME_NUMBERS/FILE_NAME.txt Again, the capital letters are substituted for the actual path and/or name.

    How can I modify this code to accommodate users who choose the mapped network path? I suspect it might be the forward slash, but I don’t know how to deal with it.
    Last edited by pinebush; 03-03-2016 at 04:25 PM.

  2. #2
    Registered User
    Join Date
    02-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019 / MS365
    Posts
    55

    Re: VBA cannot open file

    Is it possible to use VBA to write to a text file which is stored in a mapped network drive? Am I way off in my expectations?
    Interestingly, it works to open an Excel file from the same location, but will not work to input/out put to a .txt file.

+ 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. [SOLVED] Move/rename file on mapped drive
    By EuclideanKraken in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2014, 06:08 PM
  2. [SOLVED] VBA to check and see if network drive is mapped
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2013, 10:02 PM
  3. Upload File to a mapped drive
    By zhaype in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-07-2013, 10:50 PM
  4. Drive Letter Property not returning mapped drive letter
    By Mike_bee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-26-2013, 02:45 PM
  5. Saving files to mapped drive
    By freekrill in forum Excel General
    Replies: 1
    Last Post: 12-04-2010, 06:48 AM
  6. Hyperlink Changing Mapped Drive
    By awwall in forum Excel General
    Replies: 0
    Last Post: 01-07-2008, 08:30 PM
  7. ODBC from not mapped Drive
    By iancallaghan87 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-14-2007, 10:53 AM

Tags for this Thread

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