salut
je veux transformer ce code écrit en VBA à un code écrit en VBS pour deux champs texte d'un formulaire outlook,"ce code a marché dans le VBA oulook"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 Private Sub CommandButton1_Click() Dim xlApp As New Excel.Application Dim xlSheet As Excel.Worksheet Dim xlBook As Excel.Workbook Dim colonne As String Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.Workbooks.Open("F:\youness\segment_ref_com_20080911.xls") Set xlSheet = xlBook.ActiveSheet colonne = Me.TextBox2.Value Me.TextBox2.Value = xlSheet.Evaluate("VLOOKUP(""" & colonne & """,B:K,1,0)") Me.TextBox3.Value = xlSheet.Evaluate("VLOOKUP(""" & colonne & """,B:K,4,0)") End Sub
Partager