si tu y accède par This {sc.AddObject "This", ThisWorkbook, True}
This.Worksheets("Feuil1")
tu peux écrires:
sc.AddObject "ThisWorkbook", ThisWorkbook, True
et là tu est comme dans VBA
ThisWorkbook.Worksheets("Feuil1")
tu reformâtes ta macro de cette façon dans Excel et quand elle fonctionne elle marchera en VbScript.
ce qui marche en VbScript fonctionne en VBA, ce qui Fonctionne en VBA ne marche pas forcément en VbScript
mon dernier exemple te montre que ça marche
1 2
| txt = txt & " wb.ActiveSheet.cells(1,1)=2" & vbCrLf
txt = txt & " This.ActiveSheet.cells(1,2)=5" & vbCrLf |
Partager