+ Reply to Thread
Results 1 to 3 of 3

"Path not found" while creating text file with VBA

  1. #1
    Registered User
    Join Date
    01-28-2022
    Location
    Croatia
    MS-Off Ver
    Microsoft 365 MSO (Version 2201 Build 16.0.14827.20158) 64-bit
    Posts
    2

    "Path not found" while creating text file with VBA

    Hi everyone,

    I've had this code working last time on November 2021. Then I tried to run it on January 2022 and it raised me next error line "Runtime error '76' path not found". I've verified that folder where I want to save file exists, there are no "Read-only" conditions, I'm administrator and logged with administrator account.

    There is strange manual solution for this as i figured out.

    Here is part of code that produces error:

    Please Login or Register  to view this content.
    An "Set a = .." line is highlighet when I use debug.

    SaveLocation is string with value "C:\Users\User\Desktop\Otpremnice\2022\Sijecanj\O1-xxx\" (and that folder structure is created with MkDir (if year doesnt exists create folder, etc..))

    Manual solution is: if I edit Savelocation in immediate window from "C:\Users\User\Desktop\Otpremnice\2022\Sijecanj\O1-xxx\" to "C:\Users\User\Desktop\Otpremnice\2022\Sijecanj\O1-xxx" (removed backslash) and add backslash to "\PONUDA.txt", press F5 code executes.

    On the next execution of code same error raises. So if i edit again SaveLocation from "C:\Users\User\Desktop\Otpremnice\2022\Sijecanj\O1-xxx" to "C:\Users\User\Desktop\Otpremnice\2022\Sijecanj\O1-xxx\" (added backslash) and remove backslash from "PONUDA.txt", press F5 code executes.

    Since code worked before, i assume that some windows update broke excel file creation. I've gone over stackoverflow, googled everything and still there is no help. Tried to save directly to C:\ , to Desktop still nothing.

    If additional info is needed feel free to ask.

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: "Path not found" while creating text file with VBA

    Try this change:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-28-2022
    Location
    Croatia
    MS-Off Ver
    Microsoft 365 MSO (Version 2201 Build 16.0.14827.20158) 64-bit
    Posts
    2

    Re: "Path not found" while creating text file with VBA

    Quote Originally Posted by maniacb View Post
    Try this change:

    Please Login or Register  to view this content.
    Still same errror.

+ 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. Replies: 3
    Last Post: 11-09-2020, 05:40 PM
  2. How to make commandbutton to open another workbook "with file path change"
    By Rachel8226 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2019, 09:26 AM
  3. If File Not Found In Either Directory Then Message "File Not Found"
    By rjj920 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2016, 06:59 PM
  4. Replies: 2
    Last Post: 09-19-2013, 09:10 AM
  5. Set Variable = File Path generates "Object Required" Error
    By Brian48072 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2013, 11:42 AM
  6. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 AM
  7. Replies: 2
    Last Post: 07-07-2009, 03:05 PM

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