dcsimg
Results 1 to 4 of 4

Thread: [RESOLVED] Runtime Error '53' in Microsoft Word 2016

  1. #1

    Thread Starter
    Lively Member datapard's Avatar
    Join Date
    May 2008
    Location
    Silicon Valley, CA
    Posts
    107

    Resolved [RESOLVED] Runtime Error '53' in Microsoft Word 2016

    Hi folx, it's been a while since I've had to come to you for help. Hope you are all staying healthy during this fsking pandemic.

    Anyway the situation is this.

    I have a macro template, written in Word 2010, for a client that needs to be updated. Not the macro itself, but the body of the document. That's not the problem however. When I open the document it is supposed to open a form that is filed out and populates the document as needed.

    When I actually opened the document, I got a "Runtime error '53': File not found". The problem is that the "File" ie form, IS there.

    The code that is causing the error is:

    Code:
    Private Sub Document_New()
        Load frmPatInput
        frmPatInput.Show
    End Sub
    But if you look at the forms, you find the userform frmPatInput, so I don't understand WHY I'm getting the error message. To make things even stranger, I am currently using Word 2016, my client is using Word 2017 and isn't having any problems running the template.

    For the record, I am running Windows 8.1 Pro 64-bit and Office 2016. Can anybody think of a reason why 2016 is having the problem, yet 2017 runs fine? Also, any suggestions on how I can get the problem to stop, so I can test any changes I may make to the client's template?

    Thank you all for your time and attention,

    datapaard
    If you have to do it more than once...
    Automate it!

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,849

    Re: Runtime Error '53' in Microsoft Word 2016

    it does indicate that a file is not found, nothing to do with a form
    assuming the form is within the template as the posted code, then maybe it is not in the default location for templates or some such
    you could try fully qualifying the form, with a prefix to the document object that contains it
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    2,155

    Re: Runtime Error '53' in Microsoft Word 2016

    Or that form is supposed to load data from somewhere in its Initialize-event......
    One System to rule them all, One IDE to find them,
    One Code to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    For health reasons i try to avoid reading unformatted Code

  4. #4

    Thread Starter
    Lively Member datapard's Avatar
    Join Date
    May 2008
    Location
    Silicon Valley, CA
    Posts
    107

    Re: Runtime Error '53' in Microsoft Word 2016

    It's been two years since the last time this client needed me to deal with his template.

    You are correct Zvoni, the form WAS looking for files that it accesses during it's Initialize-event stage. Once I moved the template, that as Conn pointed out was not in the proper location, to a project folder that had access to these files, it worked fine.

    Thank you to both you and Conn for your assistance

    datapard
    If you have to do it more than once...
    Automate it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width