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: 196
Default editing code in modules through VB

hello.

due to some network drive mapping changes, I may need to
come up with a way to access a significant list of files,
and search all through them, replacing any and all
instance of a drive mapping of "i:\"
to "h:\something\othersomething\"

I can do that easy enough for the contents of the cells in
all sheets, in all files... have that working fine.

But, IF there are vb components that have it in there, I
will need to change that too.

I have looked at Chip Pearson's 'Programming to the VBE',
and have some idea how to get at the code modules, sheet
code, userforms, and class modules (though I really doubt
there are any of them in these files. Nicely done, thank
you very much, Chip.

So now I'm at the point of cycling through the
vbComponents, like this:

**************
For i = 1 To wbFileToChange.VBProject.VBComponents.Count
Step 1

MsgBox wbFileToChange.VBProject.VBComponents(i).Name

Next i
************

(I am pretty sure that that access all components... will
do the form code, the code modules, the sheet code, all in
that loop... I just put that msgbox line in there to see
what I was getting).

In the worksheet contents, I used the cells.replace method
to look for and replace stuff.

What I need to know is what I can put in where the MsgBox
is above, which will search and replace the contents of
the vbCompents.

Suggestions?

Thanks.
Mark
 
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
Where 2 place the code? (Worksheet Codes Vs. Modules) FARAZ QURESHI Excel Discussion (Misc queries) 3 February 23rd 09 02:01 AM
Delete Code Modules Programatically blatham Excel Discussion (Misc queries) 1 February 3rd 06 05:38 PM
Remove code from all modules closes Excel Stuart[_5_] Excel Programming 0 June 30th 04 06:22 PM
Strip Modules from Workbook - Code Organization Don L[_3_] Excel Programming 1 October 31st 03 04:29 PM
Scope of variable includes all Form _and_ Code modules?? John Wirt[_2_] Excel Programming 5 August 18th 03 08:27 AM


All times are GMT +1. The time now is 01:55 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"