ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening of an excel file is also giving a run time error (https://www.excelbanter.com/excel-programming/277660-opening-excel-file-also-giving-run-time-error.html)

prem

Opening of an excel file is also giving a run time error
 
Trying to make use of Excel 97/2000 programming for
reading data from excel to SQL Database

The programs was working fine for a long time 20 + months.
But suddenly failing on running the program in Visual
Basic even a simple creation of excel object & opening a
file is also giving an error

Code
Set oExcelApp =CreateObject("Excel.Application")

Set oExcelWorkbook = oExcelApp.Workbooks.Open(sFilename)
'sfilename includes the file name & path
' the error that is displayed is

run-time error '-2147022979 (8007077d)':

Method 'Open' of object workbooks failed

Try to make the excel visible also gives error

oExcelApp.Visible = True

run-time error '-2146960888 (8007fa08)':

Method 'Visible' of object '_Application' failed


Thanks
Prem

Renato Wisocki Junior

Opening of an excel file is also giving a run time error
 
"prem" wrote in message ...
Trying to make use of Excel 97/2000 programming for
reading data from excel to SQL Database

The programs was working fine for a long time 20 + months.
But suddenly failing on running the program in Visual
Basic even a simple creation of excel object & opening a
file is also giving an error

Wonderfull! I found that it's a Microsoft Patch that make's this
happen, it's SP4, so uninstall it and everything should work nice
again, or install Excel service release SR-1 and it should solve it.
God bless Bill Gates.


All times are GMT +1. The time now is 05:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com