Link to Excel in VB
Voici un Code bien utile pour "Linker" une feuille Excel a un programme VB…
‘Variable Definition
Dim MainExcel As Object
Dim MainWB As Object
Dim MasterExcel As Object
‘Excel Sheets Definition
Dim Parameters As Object
Const File_Location As String = "c:\Excel_file.xls"
‘Connection to excel File
Set MainExcel = CreateObject("Excel.Application")
Set MainWB = MainExcel.Workbooks.Open(File_Location)
Set Parameters = MainWB.Sheets("Sheet 1")
La partie pour Fermer le lien:
‘Close Excel
MainWB.Close
MainExcel.Quit
Et enfin la partie pour écrire:
Parameters.Cells(ligne,colonne).Value = "data"
a+





There are no comments for this post...yet. Be the first to leave a comment by filling out the form directly to the right.