SaveAs Failing

  • Hi,


    I have an invoice template that we are trying to use on our network. The Invoice Workbook is in a folder on our network server computer as well as the folder where the invoices are being saved to. When I use the invoice on 2 computers that are connected to the server everything works great, but when I go to the server computer to create an invoice from there I keep getting an error message saying the SaveAs failed.


    Does anyone have any ideas as to why it would work from two computers and not the other one?

  • Re: SaveAs Failing


    This is the code I'm using...



    The debugger highlights this line in the code "newWorkbook.SaveAs SaveAsFileName, xlOpenXMLWorkbook"

  • Re: SaveAs Failing


    I think Grimes0332 might be right. Your server might not map the V drive to a location on its C drive. What happens on the server if you use the full path location of the Invoices folder in place of "V:"? For example, find the actual Invoices folder location on the server and copy the complete file path and temporarily paste it for "V:"?

  • Re: SaveAs Failing


    The V drive does exist on the error computer.


    I found the actual folder location and it is the same as the code. I even tried changing the folder location and put the new folder path into the code to see if that would work and no luck.

  • Re: SaveAs Failing


    The error message says...


    Run-time error '1004':
    Method 'SaveAs' of '_Workbook' failed


    Sorry I'm not sure what a Citrix environment is. Still pretty new at this.

  • Re: SaveAs Failing


    Sorry, I can't really help. It's difficult to suggest a solution as the code is essentially correct.


    Just try one thing to see if that works.


    Use ChDir to change the default directory

    Code
    ChDir [COLOR=#333333]"V:\Invoices"


    [/COLOR]And then save using just the filename

    Code
    [COLOR=#333333]SaveAsFileName = "Inv" & " " & Range("I10").Value & " " & Range("I11").Value & ".xlsx"


    [/COLOR]Other than that, I'm out of ideas.

  • Re: SaveAs Failing


    I tried your suggestion and no luck...


    Could it have anything to do with the operating system?


    I am getting other errors with more VBA codes on the problem computer, the same codes work on two other computers.


    The Problem computer has Windows 7, the two that work have Windows 8 and 10.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!