Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    I am getting these two errors

    5151 when trying to add a new document using a specific template
    5479 when searching for a list of word documents

    I don't understand why as all this used to work fine until today (I have just come back from a holiday). This has worked fine for past couple months. I re-checked Word options and made sure the folder where the template exists is part of the trusted location, etc. I am new to Word 2007 so not sure what else should I check for.

    Anyway, the code I run is as follows:
    Error 5479 on the line if .Show = 0 Then ...
    Code:
            With Dialogs(wdDialogFileOpen)      ' Select and open the file to convert
                .Name = "*.doc"
                WordBasic.DisableAutoMacros 1
                If .Show = 0 Then               ' if convert from file selection
                    WordBasic.DisableAutoMacros 0
                    Exit Function               ' cancelled - exit conversion process
                End If
                WordBasic.DisableAutoMacros 0
            End With
    Error 5151 on the line Documents.Add ... The template pointed by ImpTemplate exists and can be loaded in the normal way through Word new/open etc options.
    Code:
        WordBasic.DisableAutoMacros 1
        Documents.Add Template:=ImpTemplate
        WordBasic.DisableAutoMacros 0
    Any help, pointer to the right direction highly appreciated. Thanks.
    Thanks.
    Robie

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    The only thing that raises a question in my mind is the use of the "WordBasic.DisableAutoMacros" - I'm not sure Word 2007 supports WordBasic in the same way that earlier versions did. When did you convert to Word 2007 - while you were on holiday?
    Wendell

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by WendellB View Post
    The only thing that raises a question in my mind is the use of the "WordBasic.DisableAutoMacros" - I'm not sure Word 2007 supports WordBasic in the same way that earlier versions did. When did you convert to Word 2007 - while you were on holiday?
    Yes. My PC was updated with Office 2007 while I was on holiday. I thought the DisableAutoMacros were a suspect too. Is there something else I can use instead?
    Thanks.
    Robie

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Researching this a bit more, you may be running into issues with the Office 2007 "Trusted Locations" issue. I haven't been able to find any indication that the WordBasic.DisableAutoMacros statement is no longer supported, but the Trust Center settings can impact whether or not you are allowed to enable/disable macros and what prompting you get. The 5479 error suggests there may be a dialog open somewhere. I presume you have seen this Enable or disable macros in Office documents background on how the macro settings have been changed in Office 2007. Also note that the document extensions for 2007 native mode documents have changed - .docx for normal and .docm for templates among others.

    Sorry I can't give you more explicit advice - perhaps others can comment on their experiences with this issue.
    Wendell

Posting Permissions

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