Hello, folks!
I am trying to manipulate a MS-Excel workbook under Visual FoxPro version 7.0
For testing purposes I am programming a little procedure using VBA inside a new blank MS-Word document.
I have the following code:
But I am getting Runtime error 91 at the line that tries to open the Excel file.
The whole idea is to open an Excel file under VFP and then count how many sheets it has in order to process one sheet each time. This 'process' would involve dumping the sheet's values into a temporal DBF and then bind it to a grid, allowing the user to modify it.
I don't want to create a new Excel Workbook, I want to load an Excel file and then count how many sheet it has.
Thanks a lot,
Arlequín
arlequin@montevideo.com.uy
I am trying to manipulate a MS-Excel workbook under Visual FoxPro version 7.0
For testing purposes I am programming a little procedure using VBA inside a new blank MS-Word document.
I have the following code:
Code:
Sub ArchivoExcel()
Dim obj As Excel.Application
Dim ShhetCount As Integer
obj.Workbooks.Open ("Abitab.xls")
SheetCount = obj.Sheets.Count
TextBox1.Text = Str(SheetCount)
End Sub
But I am getting Runtime error 91 at the line that tries to open the Excel file.
The whole idea is to open an Excel file under VFP and then count how many sheets it has in order to process one sheet each time. This 'process' would involve dumping the sheet's values into a temporal DBF and then bind it to a grid, allowing the user to modify it.
I don't want to create a new Excel Workbook, I want to load an Excel file and then count how many sheet it has.
Thanks a lot,
Arlequín
arlequin@montevideo.com.uy