Consulting

Results 1 to 3 of 3

Thread: SaveAs2 Error 4198 Command Failed

  1. #1
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,335
    Location

    SaveAs2 Error 4198 Command Failed

    I'm getting an error anytime I try to SaveAs a template or template macro enabled format. Anyone seeing this issue?
    Sub ScratchMacro()
    'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 6/23/2018
    On Error GoTo ErrHandler
       ActiveDocument.SaveAs2 FileName:="Test", FileFormat:=wdFormatXMLTemplate
       ActiveDocument.SaveAs2 FileName:="Test", FileFormat:=14
       ActiveDocument.SaveAs2 FileName:="Test", FileFormat:=wdFormatXMLTemplateMacroEnabled
       ActiveDocument.SaveAs2 FileName:="Test", FileFormat:=15
    lbl_Exit:
      Exit Sub
    ErrHandler:
      MsgBox Err.Number & " " & Err.Description
      Resume Next
    End Sub
    Greg

    Visit my website: http://gregmaxey.com

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    No problems here

    MIght be a conflict with some addin(?) -- try it bare bones and see
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,335
    Location
    Paul,
    Thanks. I should have rebooted the PC before posting. That seems to have resolved the issue.
    Greg

    Visit my website: http://gregmaxey.com

Posting Permissions

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