If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Running Macros
I have the following Macro (which I need to run on approximately 200
different workbooks) -- what is the BEST way to achieve this? Should I use a Function (and if so, what would it look like)? NOTE: I'm assuming that this Macro should reside in a Module -- but, should this be run outside of EXCEL (say, from a Form in ACCESS)? Here's my code: Does anyone see anything that I may be missing? Here's the MOST important thing I need this code to do (assuming there are no further modifications needed) ... This code (Macro) needs to perform this same task on approximately 200 different Workbooks (all residing in the same Network Directory), but ONLY when a Command Button is pressed. I'm assuming that I'll need to create a Form (in ACCESS perhaps) and call this Macro -- correct? How would I do this, and how would I get this Macro to perform this Link Update on all 200 or so Workbooks? Private Sub Workbook_Open() Dim vLinkSources Dim iLinkSource As Integer Dim AnySheet As Worksheet For Each AnySheet In ActiveWorkbook.Worksheets ActiveWorkbook.Worksheets(AnySheet.Name).Unprotect Password:="mypassword" Next vLinkSources = ActiveWorkbook.LinkSources(xlExcelLinks) If Not IsEmpty(vLinkSources) Then For iLinkSource = LBound(vLinkSources) To UBound(vLinkSources) ActiveWorkbook.UpdateLink vLinkSources(iLinkSource), xlExcelLinks Next End If For Each AnySheet In ActiveWorkbook.Worksheets ActiveWorkbook.Worksheets(AnySheet.Name).Protect Password:="mypassword" Next End Sub |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Running Macros | Links and Linking | 3 | July 13th, 2006 11:30 PM | |
Running macros on ALL Excel tabs | tbong | Worksheet Functions | 1 | June 7th, 2006 08:52 PM |
Running macros without lowering security | Chip Smith | General Discussion | 2 | May 4th, 2006 07:56 PM |
Bug: Editing digitally signed templates with macros | EZStrobe | Visio | 0 | September 17th, 2005 06:19 PM |
pressing f5 opens macros window instead of running code | Winshent | General Discussion | 1 | September 8th, 2004 04:27 PM |