Question

  • Creator
    Topic
  • #4004933

    migrating a VBA-heavy Word 2016 .dotm

    by grNadpa ·

    How do I migrate a VBA-heavy Word 2016 .dotm to my wife’s office 365 . without corrupting her machine?

    Lance Whitney’s https://www.techrepublic.com/article/how-to-transfer-microsoft-word-macros-to-another-computer/ is the best I’ve found on one aspect of my migration, but not sufficient.

    My .dotm template migration needs include:
    1. Migrating the .dotm template to my wife’s Documents>Custom Office Templates folder.
    2. Establishing that .dotm and Custom Office Template folder as a “Trusted Site”. (see below)
    3. Copying an MS Excel file to a (new folder) on my wife’s machine.
    3a. Permanently assigning the Microsoft Excel 16.0 Object Library to the ,dotm’s Developer>Visual Basic>Tools>Project>References. (see below)
    4. Appending my 3 “Quick Parts” Building Blocks to my wife’s normal.dotm.

    I’ve done 1, 2, 3 above. And Lance Whitney’s page above deals with point 4.
    But…
    (3a) Despite enabling the .dotm’s Developer tab on my wife’s PC, check-marking the Microsoft Excel 16.0 Object Library and saving the .dotm, the assignment won’t stick. Subsequent re-open of the .dotm shows Microsoft Excel 16.0 Object Library not checked.
    (2) Originally there were two separate security blocks. I managed to eliminate one of them through MS file level security (though I don’t recall how), but the “untrusted” message persists.
    Curiously, when I try to File>Options>Trust Center>Trust Center Settings>Trusted Locations and try to add Documents>Custom Office Templates folder, I get a popup window indicating the location is already registered. But the warning continues to appear.

    I am reluctant to proceed for fear of corrupting my wife’s PC as she uses it for her job. On the other hand, I need a backup plan if and when I replace my laptop.

    I’m running Microsoft Windows 10 Home Build 19044 on a Dell Inspiron 15-3567 using Microsoft® Word 2016 MSO (Version 2209 Build 16.0.15629.20196) 32-bit.

    Wife’s machine running Microsoft Windows 10 Home Build 19043 on an Acer Aspire TC-885 using Microsoft Word 365 MSO (Version 2209 Build 16.0.15629.20200) 64-bit.

You are posting a reply to: migrating a VBA-heavy Word 2016 .dotm

The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our Community FAQs for details. All submitted content is subject to our Terms of Use.

All Answers

  • Author
    Replies
    • #4004952
      Avatar photo

      The next question.

      by rproffitt ·

      In reply to migrating a VBA-heavy Word 2016 .dotm

      Would be to Microsoft. Last July 2022 they rolled out a disable to VBA on Office 365. I haven’t heard of a way to re-enable VBA on the current version of 365.

      Best bet? Run the Office version that works for you. At our office we’re way back on Office 2003 because we paid for it and it still works.

      • #4005074

        Reply To: migrating a VBA-heavy Word 2016 .dotm

        by grNadpa ·

        In reply to The next question.

        Thank you @rproffitt.

        The form does appear on my wife’s P.C. and the msgbox I coded to alert me of an Object issue does show. So, circumstantial evidence suggests the VBA is operational.

        I did contact Microsoft support. They contend that this is a hardware issue and I need to contact the manufacturers to upgrade the BIOS. I remain skeptical.

        In any case, my wife’s employer would not be open to installing a different MS Office version.

        I do appreciate your response however. Thanks

        • #4005134
          Avatar photo

          Wow.

          by rproffitt ·

          In reply to Reply To: migrating a VBA-heavy Word 2016 .dotm

          BIOS. Nope. Not that.

          VBA does change over time. Functions either change a little or are removed entirely. Mostly it’s been about security so as the code’s author you get to debug the code.

          As you say, VBA works so it’s now a code problem.

          My old method was to insert lines of code that report to me “At line 45, this variable is now this” and keep going down the code until I find where it fails.

          Now if you can run an old office version this gets around having to get into the actual code and debug but from the story it’s time to debug this code.

        • #4005157

          Reply To: migrating a VBA-heavy Word 2016 .dotm

          by grNadpa ·

          In reply to Wow.

          Thank you. And I appreciate your confirming my reaction to the MS Agent’s BIOS solution is likely bogus.

          I remain convinved that the issue appears to be that check-marking the Microsoft Excel 16.0 Object Library and saving the .dotm, the assignment won’t stick between sessions.

          So, this does not appear to be an issue with my coding.
          Here are some snippets. See what you think
          Module is “Project>Modules>modRoster”
          Function UpdateRoster(pSheetname As String, _
          pName As String, _
          pAddress1 As String, _
          pAddress2 As String, _
          pCity As String, _
          pState As String, _
          pZip As String, _
          pStatus As String) _
          As Boolean

          ‘Purpose: Update Roster Workbook row
          ‘Requires: row contents
          ‘ Sheetname
          ‘Returns: True if successful
          ‘ Message and false if not

          ‘<snip: validation code for parameters >

          ‘Instantiate Roster workbook
          RosterPath = “C:\Users\” & Environ(“username”) & _
          “\Documents\Integro\Rosters.xlsx”
          On Error GoTo UpdateRosterError

          Set exWb = objExcel.Workbooks.Open(RosterPath)

          ‘<snip: code when open successful>
          Exit Function

          UpdateRosterError:
          MsgBox “Error initializing Roster Spreadsheet.” & vbCrLf & _
          “Have programmer confirm that” & vbCrLf & _
          “(1) MicrosoftExcel 16.0 Object Library” & vbCrLf & _
          vbTab & “checked in Project References” & vbCrLf & _
          “(2) ” & RosterPath & vbCrLf & _
          “folder is present”, vbCritical, “InsertRow”
          exWb.Close
          Set exWb = Nothing
          UpdateRoster = False
          Exit Function

          In any case, I’m considering replacing the excel file with a simple .csv file — particularly since I’ve encapsulated all the excel-facing code in the module that contains the above snippets.

          I do appreciate all the effort and consideration you’ve shared on this issue

    • #4005158
      Avatar photo

      Rewind. There are complaints about this.

      by rproffitt ·

      In reply to migrating a VBA-heavy Word 2016 .dotm

      https://www.reddit.com/r/vba/comments/t1bw8l/microsoft_office_160_object_library_is_missing/ was unclear in the fix but
      https://forums.autodesk.com/t5/revit-api-forum/microsoft-excel-16-0-object-library-missing-from-com-reference/td-p/10450021 did a better dive into what to check out.

      In short I would be seeing if the path and file match reality in Office.

      If the path or file is off then I can see Office uncheck it when run.

Viewing 1 reply thread