-
Aug 24th, 2015, 12:52 PM
#1
Thread Starter
New Member
Externalize VBA Code
I'm a VBA novice and am working on unique project. I'm creating Macros for PowerPoint that process content for contract designers (I don't have any access to their machines or networks). I'll be distributing "templates" (in PPTM files) that contain the Macros to the designers. Ideally, I'd love to have remote control over the VBA code in the Macros after these PPTM templates are distributed. Is there any way to accomplish this? Ideally, something like including a script tag in JavaScript that contains code from an external source (e.g. a hosted JQuery library on Google APIs). Anything similar available for VBA?
Thanks!
Patrick
-
Aug 24th, 2015, 03:32 PM
#2
Re: Externalize VBA Code
you could shell out to any other program or .vbs script, or use activex .dll files
i am not sure that is what you are asking though
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Aug 25th, 2015, 11:30 AM
#3
Thread Starter
New Member
Re: Externalize VBA Code
Thanks for your reply!
I did find a solution (in case anyone else is wanted to do a similar thing). I store the script for my Macro in a online text file (ex. http://www.domain.com/myVBACode.txt). I retrieve the string of text from this file utilizing XMLHTTP. I then add this string to the code utilizing the AddCode method from a ScriptControl object. The code can be run via the Run method of the ScriptControl object.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|