Solved

VBOLE32.DLL and MSVBVM60.DLL Errors using Word Object

Posted on 2002-04-16
5
221 Views
Last Modified: 2010-05-02
Hi,

I am trying to use a Word Object in a VB program. I have successfully managed to create documents and insert text, etc., however, I also want to be able to search the documents for certain words and replace all occurances with other strings. I have followed the information carefully in the Word reference help file, however, when I use the recommended code I always get a fatal error with the message that VB has cause an error in OLE32.DLL followed immediately by another error message that VB has caused an error in MSVBVM60.DLL.

Oone example of code which causes this error is as follows (this code was generated by recording a macro but I have also tried several other methods from the help file, etc., and every try causes the same problem!)

    Set wapp = New Word.Application
    Set wdoc = wapp.Documents.Open(Filename)
    wapp.Visible = True
    wapp.WindowState = wdWindowStateMaximize
    wapp.ShowMe
    wapp.Selection.Find.ClearFormatting
    wapp.Selection.Find.Replacement.ClearFormatting
    With wapp.Selection.Find
        .Text = "Client Title"
        .Replacement.Text = ClientTitle
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    wapp.Selection.Find.Execute Replace:=wdReplaceAll

I will appreciate any suggestions. Thanks in advance.

Colin.
0
Comment
Question by:cbitservices
  • 3
  • 2
5 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 6947193
Hi cbitservices,

sounds like there is a installation gone wrong or something? have you installed old versions of these dll's with a current installation?

maybe installing SP4 for VB will help both dll's are included

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q235420

:O)Bruintje
0
 
LVL 1

Author Comment

by:cbitservices
ID: 6947302
Hi Bruintje,

I already have SP4 installed. Any other suggestions? Thanks,

Regards,

Colin.
0
 
LVL 44

Accepted Solution

by:
bruintje earned 100 total points
ID: 6947322
Hi Colin,

found one reference without solution, the asker there had the same problem only with SP5, he reported though it was running on a machine without SP4/SP5 guess even without VB.....

if you can try it to see if it runs without problems at least we know where to look for the problem although it seems pretty clear it's in the version of the OLE32.DLL

:O)Bruintje
0
 
LVL 1

Author Comment

by:cbitservices
ID: 6947400
Hi Bruintje,

Sorry, you lost me there! I tend to agree with you that the problem may be the OLE32.DLL version. So what are you suggesting that I try, are you suggesting that I try running it on another machine? Thanks,

(Sorry for my ignornace!),

Colin.
0
 
LVL 1

Author Comment

by:cbitservices
ID: 6985773
I still haven't actually solved the problem, but tend to agree that it must be an installation problem of some sort. I will have to keep trying!

Cheers,

Colin.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now