Problème entre excel et vb

gouzou44 Messages postés 33 Date d'inscription jeudi 28 décembre 2006 Statut Membre Dernière intervention 5 février 2009 - 29 oct. 2007 à 22:39
gouzou44 Messages postés 33 Date d'inscription jeudi 28 décembre 2006 Statut Membre Dernière intervention 5 février 2009 - 29 oct. 2007 à 22:40

1 réponse

gouzou44 Messages postés 33 Date d'inscription jeudi 28 décembre 2006 Statut Membre Dernière intervention 5 février 2009
29 oct. 2007 à 22:40
Bonsoir,

Je me suis créer un programme en VBA pour installer des logiciels les uns à la suite des autres. J'ai édité mon code (il fonctionne parfaitement) en VBA sur excel et je voulais le mettre en VB pour en faire un executable. J'ai donc copier tout mon code VBA dans vb2005 express edition. Lors de la compilation il m'indique que j'ai plein d'erreur (ca peut se comprendre c'est pas le meme logiciel). J'ai donc cherché à les résoudres mais je n'y suis pas parvenu. Je voulais donc savoir s'il était possible que vous m'aidiez???

Je vous présente une partie de mon code.

Option Explicit
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Dim confirmation As Integer
Dim i As Integer
Sub macro1()
Dim j As Integer
j = 0
i = 1
While i < 100 And j = 0
confirmation = 0
Call application
i = i + 1
If confirmation = 2 Then
confirmation = MsgBox("Voulez-vous quitter l'installation???", vbYesNo, "Installation")
If confirmation = 6 Then
j = 1
Else
confirmation = MsgBox("Voulez-vous revenir à l'installation précédente???", vbYesNo, "Installation")
If confirmation = 6 Then
i = i - 2
End If
End If
End If
Wend
End Sub




Private Sub application()
Dim a As Integer
Select Case i


Case 1: confirmation = MsgBox("Installer Alcohol 120%", vbYesNoCancel, "Installation")
If confirmation = 6 Then
ShellExecute vbNull, "open", "F:\FTP\iso instal\Windows\Alcohol 120%\serial.txt", vbNull, vbNull, 1
Shell """F:\FTP\iso instal\Windows\Alcohol 120%\setup.exe""", vbNormalNoFocus
a = MsgBox("Installation Fini???", vbOKOnly, "Installation")
End If
End Select
End Sub
0
Rejoignez-nous