Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VBOLE32.DLL and MSVBVM60.DLL Errors using Word Object

Posted on 2002-04-16
5
Medium Priority
?
245 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 300 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

721 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