none
VBA File Copying Error

    Pertanyaan

  • Please forgive me, but it's difficult to troubleshoot the issue with the other user due to their not being available and my being unable to reproduce it. So, I'm looking for ideas on what the problem could be so that I can minimize the impact on their schedule.

    I have file duplication working flawlessly, or so it seemed. As I submit a form of data, the appropriate template is copied and populated with the data from the form.

    Then access was shared with a second user and, while it still works fine for me, they get:

    A file with this name already exists.
    
    To replace the existing file, click OK.
    
    To type a different name for the file, click Cancel.

    Well, they can't give it a different name as the automation is dependent upon uniform naming. Furthermore, we've confirmed the no such file existed at the time of the prompt.

    So, we naturally selected "OK" to override the non-existent existing file. That's when the program errs to the FileSaveAs line. Checking the value of the Name path, we've confirmed it is exactly what is expected and the file called out does not exist in the directory.

    I've confirmed they have identical permissions to me for the project directory and files, the only exception being that I have permissions added as part of an AD group and directly, regardless it's Full Control, so there shouldn't be an issue with that.

    We even thought it might be that they hadn't logged off/on since their permissions were added to the network, but doing that had no impact on the issue.

    Without being able to work with the code while on their account, I'm at a loss on how I might reproduce it to better figure out how to address it. Does anyone have any ideas as to what might be wrong?

    Jumat, 06 Juli 2018 21.09

Jawaban

  • My apologies for the wait and thanks for responding, I needed to be able to sit down with the other user to work the issue as I could not recreate it with my account. Since I didn't know when I'd be able to do so, I wanted to ask, in case anyone had encountered the issue before.

    In the process of doing so, I was able to resolve the issue. Earlier in the development of the setup, I was having trouble getting the VBA to save and close files using:

    FileCloseEx Save:=pjSave, NoAuto:=True, CheckIn:=True

    The solution I'd come up with, which was working perfectly fine from my account, was:

    ActiveProject.SaveAs name:=ActiveProject.path & "\" & ActiveProject.name
    FileCloseEx Save:=pjSave

    My guess is that during the development I had something in the code that was messing it up (no clue what, though). I reverted the save points back to the original code and it worked for me and the other user.

    Rabu, 11 Juli 2018 13.19

Semua Balasan

  • Angel,

    It would help if you could explain exactly what you are trying to do and in what environment. It would also be helpful to see the macro code you have.

    Without that basic starting point, I (or anybody else) would be "shooting in the dark" with respect to having any ideas.

    John

    Sabtu, 07 Juli 2018 02.31
  • My apologies for the wait and thanks for responding, I needed to be able to sit down with the other user to work the issue as I could not recreate it with my account. Since I didn't know when I'd be able to do so, I wanted to ask, in case anyone had encountered the issue before.

    In the process of doing so, I was able to resolve the issue. Earlier in the development of the setup, I was having trouble getting the VBA to save and close files using:

    FileCloseEx Save:=pjSave, NoAuto:=True, CheckIn:=True

    The solution I'd come up with, which was working perfectly fine from my account, was:

    ActiveProject.SaveAs name:=ActiveProject.path & "\" & ActiveProject.name
    FileCloseEx Save:=pjSave

    My guess is that during the development I had something in the code that was messing it up (no clue what, though). I reverted the save points back to the original code and it worked for me and the other user.

    Rabu, 11 Juli 2018 13.19
  • Angel,

    Okay, I'm glad you resolved your issue.

    John

    Rabu, 11 Juli 2018 19.51