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!

Importing upgraded VBA code 9

Status
Not open for further replies.

krinid

Programmer
Jun 10, 2003
356
0
0
CA
I'm creating a system to download upgrades to Excel VBA code without having to resend the entire file. Anyone know a good way to delete existing modules and add new modules via VBA code?

I'm considering putting all code in worksheet objects instead of modules, and then just copying/deleting the worksheets from the update server as necessary. I've got the framework for this solution prepared, but this is kind of a roundabout solution; I'd rather copy the actual modules if possible.
 
Hi, I have a similar problem.

I'm adding a new module with an UDF..user defined function thats used from within the Excel spreadsheet (like =Sum())

In any case, i'm adding the function to a different sheet, and I want to compile that sheet or else the function will not work. I cannot use Application.Run or Application.OnTime because it is a function not a procedure as was stated here:

Does anyone have any idea's how I can compile the VBA code of another sheet after I add the module with a function to it?

Or perhaps: using the DateDiff() function available in the VBE but not as a UDF in the spreadsheet area? ie. i can't use =DateDiff(A1,A2)... anyone know how I can without using UDFs?


Thanks

Frank
 
Fherrea,
Can't you pass parameters in with Application.Run or Application.OnTime? I didn't realize they couldn't be used with functions.

Anyhow, why not use Application.Run or Application.OnTime to execute a sub which calls the function you want executed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top