Using VB 5.0 to automate Excel 5.0
Posted on 1998-02-19
Is it possible to automate Excel 5.0 from VB 5.0?
I am writing a small VB application which needs to be able to open an Excel spreadsheet, select specific cells and read the data they contain. I have successfully managed to automate this using Excel 8.0 but when I try it with Excel 5.0, I get run time error 430 "Class doesn't support automation".
I noticed in the VB help that the syntax for referring to the Excel application class is "set oexcel = new excel.application" for Excel 8.0 but "set oexcel = new [_excelapplication] for Excel 5.0 but I still can't get it to work even though I've taken this into account.
I'm not doing anything particularly flash when referencing the Excel object, just things like oExcel.Workbooks.Open(sFileName).Activate and oExcel.Cells(3, 3).Select
Any help would be greatly appreciated.