Search Replace inside Word and Excel VBA Code Modules

Discuss WordPipe, ExcelPipe and PowerPointPipe. Get help with installation and running, notify us of bugs, request new features and enhancements.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Search Replace inside Word and Excel VBA Code Modules

Post by DataMystic Support »

WordPipe and ExcelPipe now support search/replace inside Word and Excel VBA Code Modules.

You need to check the Look In location Code Modules.

You can perform a literal (exact) match using the Search Type Normal search.

Or, you can perform a pattern match using Search Type EasyPattern Wildcards or Perl regexWildcards.

As an example, to replace a subroutine called Sub HelloTest() with a new definition,

Using EasyPattern Wildcards (http://www.datamystic.com/easypatterns_reference.html), set the search text to:

Code: Select all

Sub HelloTest()[ 1+ chars ]End Sub
and set the replacement text to the new definition (you can paste a multi-line replacement function from the windows clipboard).

Using Perl regexWildcards, , set the search text to:

Code: Select all

Sub HelloTest\(\).*End Sub
and set the replacement text to the new definition.
yangkwak
Posts: 1
Joined: Fri Apr 26, 2013 6:06 am

Re: Search Replace inside Word and Excel VBA Code Modules

Post by yangkwak »

Hello,

I couldn't get WordPipe to replace my sample macro.
My sample script is as follow,

Sub TestMacro001()
'
' TestMacro001 Macro
'
'
MsgBox ("hello word! \Desktop App Readiness Test Documents\")

End Sub


"Code Modules" in checked.
And Find What is "\Desktop App Readiness Test Documents\"
Replace With is "\Desktop App Readiness Test Documents\subfolder001\"

I've tried various option but couldn't make it work. Any advice on what I am doing wrong?

Also, does it not work if I select ALL options in "Look in"?
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Search Replace inside Word and Excel VBA Code Modules

Post by DataMystic Support »

Can you send a test document and your WordPipe settings (File\Save As, .wpp file) to our support address?

Also, which version of WordPipe, Windows, and of MS Word is this?
Post Reply