Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I copy code modules from a remote file (VBA-Excel)

Status
Not open for further replies.

Rissolo

Programmer
Jun 17, 2003
5
0
0
US
This is either one question or two:
As 2 Questions (excel 2000):
1.) How do I create a command button on a worksheet using code and have it run a macro located in a remote code module (.xla) I know the ActiveSheet.OLEObjects.("cmdButton1").Object.OnAction = "MacroName" works for macros locally, but is there another version or modification that can be used to run remote code modules?

and/or

2.) How do I copy code modules or forms from a remote source (.xla or .xls) using code? I suppose I could copy a "Module" if it was attached to a worksheet, and all the subroutines and functions were specified as "Public", but is there a way to copy a module or specific subroutine without copying a worksheet?

Thanks!
Rissolo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top