View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Use VBA (Macro) to Update Existing Macro

No provision for opening a password protected project using code. Only
suggestions I have seen involve using sendkeys.

--
Regards,
Tom Ogilvy


"Jordan Marton" wrote in message
oups.com...
So I checked out the link you sent and found one of the sites that
provides a workaround. So far so good.

One more question. Several of my files have password protected macro
code (you have to type the password in the editor to see it). Any way
around that?

On Feb 12, 10:25 am, Tom Ogilvy
wrote:
exporting a module does not remove the module. You would need to delete
it
before importing a new one.

http://tinyurl.com/33edbs
has a list of articles discussing the bloodhound virus problem.

--
Regards,
Tom Ogilvy



"Jordan Marton" wrote:
I have seen that site. I tried the following code:


Sub CopyModule()
Dim FName As String
With Workbooks("MasterBook")
FName = .Path & "\code.txt"
.VBProject.VBComponents("Module1").Export FName
End With
Workbooks("OldFile").VBProject.VBComponents.Import FName
End Sub


Figured I could export then import into the new excel file. Problem
is, my virus program keeps blocking me from saving this code, says it
is a Bloodhound virus or something. I am on a corporate network and
turning the virus checker off is not an option. Any other ideas?


On Feb 12, 9:36 am, Tom Ogilvy
wrote:
http://www.cpearson.com/excel/vbe.htm


should give you the ins and outs of writing code to manipulate code.


Hopefully your projects are not protected in any of the workbooks.


--
Regards,
Tom Ogilvy


"Jordan Marton" wrote:
Hi.


I have about 100 files that have the same embedded macro in them. I
need to update one of the functions that is contained in the macro
code.


I know how to loop through all the files, open each one, and save/
close them.


What I don't know how to do is modify the embedded macro functions.


Can someone please tell me how I can replace a function with a new
one
automatically so I don't have to open the code editor for each one.


Thanks- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -