J'utilise AutoIt3 depuis peu.
J'aimerais lancer une macro VBA qui est dans un fichier Excel.
Code : Tout sélectionner
#include <ExcelCOM_UDF.au3>
$oExcel = _ExcelBookOpen ("<chemin>\titi.xls", 1)
If @error = 1 Then
MsgBox (0, "Error!", "Unable to start Excel object")
Exit
ElseIf @error = 2 Then
MsgBox(0, "Error!", "File does not exist")
Exit
EndIf
_ExcelWriteCell ($oExcel, "coucou", 1, 1) ; ça marche nikel :))))
$oExcel.Application.Run ("ma_macro") ; cette ligne ne fonctionne pas :(((
_ExcelBookClose ($oExcel)
$oExcel.Application.Run ("ma_macro")
$oExcel.Application.Run ("ma_macro")^ERROR
Error: The requested action with this object has failed
La macro Excel est très simple:
Code : Tout sélectionner
Sub toto()
range("H6").Select
ActiveCell.Text = "TOTO"
End Sub
Ne faut-il pas nommer la feuille qui contient la fonction Excel ?

