d'une macro a une autre j'y arrive (trouver sur un site)
Set sh = WScript.CreateObject("WScript.Shell" )
on error resume next
sh.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security\accessVBOM",1,"REG_DWORD"
on error goto 0
Set exl = WScript.CreateObject("excel.Application" )
exl.Visible = false
set fichxl=exl.workbooks.add
Set mdle = fichxl.VBProject.VBComponents.Add(1)
mdle.CodeModule.InsertLines 1,"sub Macro1()"
mdle.CodeModule.InsertLines 2,"Dim baratin As String"
mdle.CodeModule.InsertLines 3,"baratin = ""mon topo à lire"""
mdle.CodeModule.InsertLines 4,"ExecuteExcel4Macro ""set.name(""""nom1"""","""""" & baratin & """""" )"""
mdle.CodeModule.InsertLines 5,"End sub"
mdle.CodeModule.InsertLines 6,"sub Macro2()"
mdle.CodeModule.InsertLines 7,"msgbox Application.ExecuteExcel4Macro(""get.name(""""nom1"""" ) "" )"
mdle.CodeModule.InsertLines 9,"end sub"
exl.Run "Macro1"
exl.Run "Macro2"
fichxl.close(false)
exl.quit
Set fichxl=nothing
set mdle=nothing
set exl=nothing
set sh=nothing