LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200

I just upgraded to Office Professional 2003 from Office Professional XP.

The following code, when executed, completely and irrevocably crashes
Microsoft Excel 2003 at the line <.Text = "^pDescription". It worked just
find in Microsoft Excel XP. It even asks to send a report to Microsoft. Every
time. Easily reproducible. I have updated to all service packs/patches, etc.,
too.

Also, the line <Selection.Find.Replacement.ClearFormatting gives a
"Automation error: the procedure number is out of range" error, which it
didn't do before in Excel 2003.

What the heck happened between the two versions? Now my code has completely
blown up!!! Any ideas????? Any help would be greatly appreciated, as we have
to get this program up and running for production! Thanks!!!

Public Sub Test()
Dim appWord As Word.Application

Set appWord = New Word.Application
appWord.Documents.Add

appWord.Selection.Find.ClearFormatting
appWord.Selection.Find.Replacement.ClearFormatting
With appWord.Selection.Find
.Text = "^pBREAK"
.Replacement.Text = "-----"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
appwordSelection.Find.Execute Replace:=wdReplaceAll

appWord.ActiveDocument.SaveAs "C:\TEST.DOC"
appWord.ActiveDocument.Close
appWord.Quit

Set appWord = Nothing

End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy in Excel 2003 Paste in Word 2003 Confused Excel Discussion (Misc queries) 2 March 7th 08 09:25 PM
Excel 2003 Crashes Al G. Excel Discussion (Misc queries) 1 February 1st 08 04:58 AM
Copy and paste problem Excel 2003 to Word 2003 [email protected] Excel Discussion (Misc queries) 2 August 28th 07 11:14 AM
Need help with mail merge - excel 2003 to word 2003 please.. Sara Excel Discussion (Misc queries) 0 May 7th 07 11:24 PM
Excel Automation Find/Replace Excel 2000 and 2003 scorpion53061 Excel Programming 0 January 30th 04 10:13 PM


All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"