Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 250
  • Last Modified:

VBOLE32.DLL and MSVBVM60.DLL Errors using Word Object

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
cbitservices
Asked:
cbitservices
  • 3
  • 2
1 Solution
 
bruintjeCommented:
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
 
cbitservicesAuthor Commented:
Hi Bruintje,

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

Regards,

Colin.
0
 
bruintjeCommented:
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
 
cbitservicesAuthor Commented:
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
 
cbitservicesAuthor Commented:
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

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now