Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a macro to a module in Excel
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00935206
Message ID:
00935251
Vues:
18
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform