Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: Open DOC file

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am trying to open a MS .DOC file from an Excel workbook but I get an error message: 424 - Object Required. I don't know what it means / what I need to do. My code is:

    Application.ActivateMicrosoftApp xlMicrosoftWord
    Documents.Open FileName:=FileNm, ConfirmConversions:=False, ReadOnly _
    :=False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate _
    :="", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="" _
    , Format:=wdOpenFormatAuto

    The open MS Word works ok. The problem comes whentring to open the file.

    Thanks for your help.
    Michael


  2. #2
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Does "FileNm" contain the name/fullpath of a file that exists?

    If it doesn't then this would probably cause this error.

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I don't have an answer for you, but you might try doing a search. I found this earlier reference, hope it helps.

    http://www.mrexcel.com/board/viewtop...c=2628&forum=2

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    error message: 424 - Object Required

    this is an eror related to an object top link word and excel object are made, well thisis the simplist way see samples.xls for code, (should be installed when you installed office)

    and so the codes wrong, suggest de bug and see wher it trips, my guess the objects or file locations, this on a LAN..

    be careful what your PC sees is not the servers sights.

    HTH

    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

  5. #5
    Board Regular
    Join Date
    Apr 2002
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Bergy,
    Thanks for the reference tip but there are two problems with the solution:

    1) I had to change
    "Dim appWD As Word.Application"
    to
    "Dim appWD As Application"

    2) It always opens a new Word Window weather or not Word is already open and wheather or not the DOC file is already open.

    Anyway to avoid problem 2?

    Thanks,
    Michael

  6. #6
    Board Regular
    Join Date
    Apr 2002
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Bergy,
    Thanks for the reference tip but there are two problems with the solution:

    1) I had to change
    "Dim appWD As Word.Application"
    to
    "Dim appWD As Application"

    2) It always opens a new Word Window weather or not Word is already open and wheather or not the DOC file is already open.

    Anyway to avoid problem 2?

    Thanks,
    Michael

  7. #7
    Board Regular
    Join Date
    Apr 2002
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Bergy,
    CORRECTION to:
    1) I had to change
    "Dim appWD As Word.Application"
    to
    "Dim appWD As Application"

    It should have read:
    "I had to eliminate it."

    Thanks,
    Michael

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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