Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi I am trying but without success to get data from an excel 2003
spreadsheet into Visual Basic 6 I have tried to use the following code but to no avail.Any suggestions please would be really appreciated.RegardsFredSub OpenExcel7Sheet() Dim dbs As Database Dim rst As Recordset Dim intNumRecords As Integer ' Open the Microsoft Excel workbook named Data.xls without exclusive access ' and with read/write permissions. Set dbs = OpenDatabase("C:\Excel\Data.xls",False, False, "Excel 5.0;HDR=No;") ' Create a Recordset from the worksheet. The dollar sign character following ' the sheet name tells the installable ISAM that the code is referencing the ' entire sheet. Set rst = dbs.OpenRecordset("SampleSheet$") ' Use the MoveLast method to populate the Recordset; use the RecordCount ' property to count the records and display a message that gives the results. rst.MoveLast intNumRecords = rst.RecordCount MsgBox "There are " & intNumRecords & " rows in this worksheet." rst.Close End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic and Excel 2003 and 2007? | Excel Programming | |||
Excel 2003 visual basic for 'spinbutton' | Excel Discussion (Misc queries) | |||
Excel 2003 visual basic help shows nothing | Excel Programming | |||
Can Visual Basic 2005 be used in Excel 2003? | Excel Programming | |||
changing the visual basic in office 2003 to visual studio net | Excel Discussion (Misc queries) |