-
1
- #1
Hi,
I had written code to open the excel application through powerbuilder using oleobject. My code was protecting a range of excel cells. It was working fine on excel 2007. Now my machine has excel 2010. Oleobject open function is giving error at open function. How can I correct that.
ole_excel = CREATE oleObject
li_return = ole_excel.ConnectToNewObject('excel.application')
If li_return < 0 then
Messagebox("Error","Unable to Connect Excel Application")
Return -1
End If
//To off the alert
ole_excel.Application.DisplayAlerts = "False"
ole_sheet = ole_excel.workbooks.open(docpath)
This open function is not working to open the excel 2010 file.
It is showing NULL object reference error.
Please suggest.
I had written code to open the excel application through powerbuilder using oleobject. My code was protecting a range of excel cells. It was working fine on excel 2007. Now my machine has excel 2010. Oleobject open function is giving error at open function. How can I correct that.
ole_excel = CREATE oleObject
li_return = ole_excel.ConnectToNewObject('excel.application')
If li_return < 0 then
Messagebox("Error","Unable to Connect Excel Application")
Return -1
End If
//To off the alert
ole_excel.Application.DisplayAlerts = "False"
ole_sheet = ole_excel.workbooks.open(docpath)
This open function is not working to open the excel 2010 file.
It is showing NULL object reference error.
Please suggest.