Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a macro to a module in Excel
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00935206
Message ID:
00935251
Views:
19
getting a list of modules in a worksheet
set safe off
oE = GETOBJECT(,'excel.application')

** create a table with the module names in it
** search for sub routines in the memo of each module macCode
create table mac (mnum n(5) , mname c(40), mcode m(4))
sele mac
WITH oe.ActiveWorkBook.VbProject
    For i = 1 TO 	.VBComponents.count
	    mmname =   	.VBComponents[i].name
    	go bott
    	insert blank
    	go bott
    	repl mname with mmname
    	repl mnum with i

		macName =	.VBComponents[i].name
		macCode = 	.VBComponents[macName].codemodule.lines(1,100000)
		repl mcode with macCode
    EndFor
EndWith
go top
brow
resources:
http://www.cpearson.com/excel/vbe.htm
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=uFqjLMevBHA.2592%40tkmsftngp04&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26q%3Dexcel%2Bprocstartline%2Bvfp
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform