Consulting

Results 1 to 3 of 3

Thread: Word 16 on macOS 12.6 (M1 chip) cannot find template

  1. #1
    VBAX Regular
    Joined
    Jan 2006
    Posts
    56
    Location

    Word 16 on macOS 12.6 (M1 chip) cannot find template

    Hi all,

    I have several macros that I used, via shortcut keys defined in AutoExec of Normal, to open a new document based on a custom template I have saved in
    the same folder as AutoExec.

    These macros have worked fine on Office X, Office 2004 and 2011 (both PPC and intel-based Macs).
    On a new laptop with an M1 chip I get Error #4198 cannot find the requested file or folder.

    I have all the macros and the templates installed in the default location for Word 16:

    Macintosh HD:Users:" & TheUser & ":Library:Group Containers:UBF8T346G9.Office:User Content:Templates:ERI Templates:
    where TheUser is the specific User on the laptop using Word.

    The code snippet is:

       
       TmpPath = "Macintosh HD:Users:" & TheUser & ":Library:Group Containers:UBF8T346G9.Office:User Content:Templates:ERI Templates:"
       TmpName = "VM_Notes.dotm"
    
       Application.ScreenUpdating = False
       Documents.Add Template:=TmpPath & TmpName, DocumentType:=wdNewBlankDocument, Visible:=True
    The Documents.Add method is the command that is failing.

    The permissions on the template, and the enclosing folders is correct, the User has read/write and execute privileges.

    Any idea what I need to do to get Word 16 to execute the Documents.Add method from a Macro?
    I can create a new document based on the same template via the Gallery, by hand.

    Thanks,

    --Ed

  2. #2
    VBAX Regular
    Joined
    Jan 2006
    Posts
    56
    Location
    SOLVED:

    The problem was the path delimiter and the root disc name.

    Replacing : with forward slash (/) resolved the problem.

    The corrected code snippet is:
       
       TmpPath = "/Users/" & TheUser & "/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Templates.localized/ERI Templates/"
       TmpName = "NumberedHeadings.dot"
    Also the explicit naming of the disc the template is located on is also dropped. Replacing "Macintosh HD" with "/" was also needed.

    I haven't seen this change documented at any of the VB MS sites.

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,234
    Location
    Thank you for putting your solution up.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

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