Excel : errors

Excel : errors

Postby Franklin Demont » Tue Oct 30, 2012 11:22 am

Hello,

I have an aplication where the user can print to a excel-file. It has always worked without problems.

The last months i got many errors , while i didn't changed nothing in the source related to excel.

As an example :

Code: Select all  Expand view

oExcel        := CreateObject( "Excel.Application" )
oWorkBook := oExcel:WorkBooks:Add()
IF ! IsNil(oExcel)
  nSheets := oExcel:Sheets:Count()   ==> ERROR !!
END
 


Error description: Error Excel.Application:ACTIVESHEET:CELLS:_VALUE/0 S_OK: SHEETS
Called from: => TOLEAUTO:SHEETS( 0 )
Called from: B:\HENWINNEW\PRINTSYSA.PRG => STARTPRINTER( 725 )

Another example :
oSheed := oExcel:Get( "ActiveSheet" )
oSheed:Cells(nRij,nKol):Value := "test"
Error description: Error 2256468/424 Unknown error: CELLS
Args:
[ 1] = N 1
[ 2] = N 3
Called from: => TOLEAUTO:CELLS( 0 )

Testing on a computer from 5 years ago , i have no problems , but mine customers can not use excel anymore

Frank
test
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am

Re: Excel : errors

Postby Enrico Maria Giordano » Tue Oct 30, 2012 3:16 pm

Try to reinstall Office.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Excel : errors SOLVED

Postby Franklin Demont » Tue Oct 30, 2012 3:23 pm

Changing oExcel:GET("ActiveSheet") in oExcel:Activesheet seems to solve the problem.

Probably oExcel:GET("ActiveSheet") works in XHB (commercial) , not with BCC

Frank
test
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 75 guests