Hi all,
I'm pulling my hair out trying to open an Excel file with VB6. The code is as follows
The GetObject line will always give me an error "Run-time error '13': Type mismatch". However, if I use the CreateObject command instead of the GetObject everything goes well. Yes, the file that I'm trying to open is in the right location, but I have no idea what's wrong. Any help will be appreciated. Thank you.Code:Dim AppExcel As Excel.Application Dim wSheet As Worksheet Dim wBook As Workbook Private Sub Form_Load() Set AppExcel = GetObject("c:\MyFile.xls") End Sub
Robert




Reply With Quote