+ Reply to Thread
Results 1 to 4 of 4

Bug help appreciated

  1. #1
    Forum Contributor
    Join Date
    12-16-2005
    Posts
    161

    Bug help appreciated

    I have written an excel application which runs fine on WindowsXP/Office 2003 which works fine in this environment.

    When I run the application on Windows 2000/Office 2000 I get a Prgram Error message (Excel.exe has generated errors and will be closed by Windows. You will need to restart the program).

    The feature that fails creates a word document report. This is the code:

    Dim wdApp As Word.Application
    Dim wdDoc As Document
    Dim wdRng As Word.Range

    Set wdApp = New Word.Application

    Set wdDoc = wdApp.Documents.Open(Environ("userprofile") & "\My Documents\ROI Advantage\Business Case Template AL.dot")

    wdApp.Visible = False

    etc etc

    The line of code that causes Excel to fail is "wdApp.Visible=False"

    Any ideas on how to resolve this would be appreciated.


    Cheers
    PeterT

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Peter,

    I first thought this might be a binding issue. Your code uses early binding. I wrote the code below to use late binding and inserted a breakpoint at the WordApp.Close statement. The first time I ran the code I got a different error "Object doesn't support this property or method." I ran the code again and it worked. However, when it executed the WordApp.Quit statement, my anti-virus program alerted me that "Excel was running a suspicious script". I am using Excel 2000. This appears to be a genuine bug. Unfortunately, I don't know of any work arounds for it.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    12-16-2005
    Posts
    161

    Thanks Leith

    Thanks for your feedback, much appreciated - strange thing is your code works fine for me with a clean excel sheet! I'll keep plugging away - FYI the excel error code generated is c0000005 (access violation).

    Cheers

    Peter

  4. #4
    Forum Contributor
    Join Date
    12-16-2005
    Posts
    161

    Problem resolved

    Somehow I had managed to corrupt a Word Object library.

    Cheers

    PeterT

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1