VB Excel. Application

Bumblebee - 20 juin 2001 à 07:08
 Patrice - 20 juin 2001 à 18:15
I am working on a VB program which automatically extracts a column/cell from an Excel spreadsheet, then graph it. Anyone please help??

1 réponse

Hello,

Here is an example of code à to place in a leaf, after having made reference to the library of EXCEL in the slim project - references of VISUAL BASIC
I hope that it will answer à your question and me hopr especially well to have understood your question because my English is not perfected.

Regards.

Patrice



Public Excel_Application As Excel.Application

Private Sub Command1_Click()
Set Excel_Application = CreateObject("excel.application")
Excel_Application.Workbooks.Open ("c:\essai.xls")
Excel_Application.Worksheets("feuil1").Select
x = Excel_Application.Range("a1").Value
y = Excel_Application.Range("a2").Value
z = Excel_Application.Range("a3").Value
Excel_Application.Workbooks.Close
Excel_Application.Quit
Set Excel_Application = Nothing
Print x + y + z
End Sub
0
Rejoignez-nous