+ Reply to Thread
Results 1 to 6 of 6

UNC filepath in Text file import VBA

  1. #1
    Registered User
    Join Date
    05-02-2010
    Location
    Cambridge
    MS-Off Ver
    Excel 2007
    Posts
    10

    UNC filepath in Text file import VBA

    Hi All,

    I have a macro which imports a text file into excel and formats it with delimters. The problem I have is that I tried to convert the "TEXT;A:\.." file path to a UNC style one "TEXT;\\Server\.." and keep getting a error highlighting this line.

    I tried removing the two backslashes but that didn't work, any ideas?

    Will

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: UNC filepath in Text file import VBA

    Hi

    It would help if you had given the command line you are using.

    Try
    Please Login or Register  to view this content.
    rylo

  3. #3
    Registered User
    Join Date
    05-02-2010
    Location
    Cambridge
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: UNC filepath in Text file import VBA

    Hi,

    The line in red is causing me the problem, I want to convert it to a UNC filepath but \\server\datashere\commercial etc gives an error.

    Please Login or Register  to view this content.
    Any ideas?
    Last edited by shg; 07-23-2010 at 11:26 PM. Reason: Make the bold text red.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: UNC filepath in Text file import VBA

    Hello Will31,

    Unfortunately this forum has not yet addressed the outstanding issue of the color tags not working in the code pane. You have to use bold type instead.

  5. #5
    Registered User
    Join Date
    05-02-2010
    Location
    Cambridge
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: UNC filepath in Text file import VBA

    OK Leith thanks

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: UNC filepath in Text file import VBA

    Hi

    I didn't click that you were using an A drive. Presumably that is some sort of added drive??? Just for an experiment, put the text file onto the default drive for the machine (C???) and see if that works. I'm not sure if the error is one of syntax, or it cannot find the file. I've a funny feeling that the UNC only works on the default drive for the machine.

    rylo

+ 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