Link to home
Start Free TrialLog in
Avatar of morye
morye

asked on

Illegal operation error while running a application with MS Word.

In my VB program, it contains a function to export a data to MS Word.

I had install the VB program to several computers. But, only one computer have this error appear. The computer is use Win 2000 and Office 2000.

"This program has performed an illegal operation and will be shut down."

It said is the problem with kernel32.dll and seems to be is a window problem.
it was because the program is work fine at before. It just appear this error few days ago.


How can I solve this problem??

Please help~~
Thank you
Avatar of lacams
lacams

What is the function that you use ?
Have you created a Word Object ?
What is the os type and Office version where this vb works fine ?

chris
Avatar of morye

ASKER

The function is....

Public wrdApp      As Word.Application
Public wrdDoc      As Word.Document
Public wrdSelection    As Word.Selection

public functiob ExportWord()

    Set wrdApp = CreateObject("Word.Application")
    wrdApp.Visible = True
   
    ' Add a new document
    Set wrdDoc = wrdApp.Documents.Add
... ...

The error was appear at the statement wrdApp.Documents.Add
The OS is Win 2000 and Office 2000.

All the computers (at the before) is the same setting.
But, all computers have use for a period.
I don't know how the user use it.

He maybe install or remove some porgrams himself. It makes some setting files changed......etc.

Thank You.
Have you try with "Set wrdApp = CreateObject("Word.Application.9")" ?

chris
Avatar of morye

ASKER

yes...but it still not work.
Avatar of morye

ASKER

I fixed the problem after I reinstall the Window.

Thank you for all of the suggestions.
ASKER CERTIFIED SOLUTION
Avatar of PashaMod
PashaMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial