Hente Værdi fra Excel til VB
Jeg har som udgangspunkt følge kode:Private Sub File1_Click()
On Error Resume Next
Set xl = CreateObject("Excel.Application")
For j = 1 To File1.ListCount
xl.Workbooks.Open "C:\test\" & File1.List(i)
xl.Visible = True
Set xlrapbook = xl.Workbooks(1)
xl.Sheets(2).Select
xl.Range("B1").Select
xl.Range("B1").Select
MineData = xl.Range("B1").Value
xlrapbook.Close False
Next j
err:
xlrapbook.Close True
xl.Close
xl.nothing True
End Sub
- Havde håbet på at jeg ville ha´ haft en værdi i
"MineData = xl.Range("B1").Value"
dette er dg ikke tilfældet :-(
Kan nogen hjælpe
vh
Compilos
