Solved

VBOLE32.DLL and MSVBVM60.DLL Errors using Word Object

Posted on 2002-04-16
5
238 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 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses
Course of the Month6 days, 11 hours left to enroll

636 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