+ Reply to Thread
Results 1 to 7 of 7

Issue saving file if in users or network drive

  1. #1
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    200

    Issue saving file if in users or network drive

    Hello,

    I am having an issue saving a file via VBA if the directory does not exist somewhere directly under C:\. It may be a permissions issue under the users folder, but not sure why this is the case in the network drive. The following code is what I use to create the file and then save a version before full macro begins. Is there a better way to do this to be able to at least save on the network drive?

    Thanks!
    Please Login or Register  to view this content.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Issue saving file if in users or network drive

    I don't see a problem at first glance
    the only thing is if SegName does not exist as folder (I am assuming that that is a folder name) and you're missing out the \ before the filename
    All together, while reading the entire code saving the file looks bad

    Please Login or Register  to view this content.
    Review it, there is something entirely wrong with the code, step thought the code line by line.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    200

    Re: Issue saving file if in users or network drive

    So expected my folder to look like this, if my file is in the C:\Test:

    C:\Test\SegName.xlsx

    Is that not correct? Did you expect SegName to be a folder? Maybe I don't have that path quite right.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Issue saving file if in users or network drive

    You're the one that has to tell mee what the foldername is, is SegName is the filename then that is correct

  5. #5
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    200

    Re: Issue saving file if in users or network drive

    Sorry I don't know what "there is something entirely wrong with the code, step thought the code line by line" means, because I've stepped through multiple times and don't see an issue. The code works fine in C:\Test but doesn't work in my user folder or on our shared drive here at work. I'll try somewhere else for help.

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Issue saving file if in users or network drive

    What is the full syntax of the contents of the cell you refer to.
    With that I mean the value that results from
    Please Login or Register  to view this content.

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Issue saving file if in users or network drive

    I pasted your code in a new workbook
    Please Login or Register  to view this content.
    I moved the newbook As Object to the code itself since I don't see the reason you did otherwise

    The contents in my file is Segname.xlsx and that works
    Now and here again, what is the content of the cell in your D29? I am not going to try and think of what you've put there but I think the answer lies there, but you are free to look elsewhere for help.

    I've attached both files, the macro file and the resulting file
    Attached Files Attached Files
    Last edited by Keebellah; 04-24-2018 at 09:39 AM. Reason: attachment

+ 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] File(s) on a network drive, with multiple users. Looking for strategy help
    By rreifs68 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2015, 10:08 PM
  2. Saving File Attachment from Outlook to Network Drive
    By TRMoonPunk in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 10-30-2014, 02:36 PM
  3. Saving a copy of excel file in a remote network drive through vba
    By saji in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2013, 03:05 PM
  4. [SOLVED] VBA to create a folder on a network drive before saving the file to it?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-29-2011, 10:23 AM
  5. Saving to a network drive macro...
    By DaveNP in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-28-2010, 08:23 AM
  6. Saving To A Network Drive
    By kreiny in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-06-2009, 07:53 PM
  7. Saving Excel file to Network drive
    By kantjer in forum Excel General
    Replies: 5
    Last Post: 04-06-2005, 09:16 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