Page 1 of 1

xbrowse to excel office 2010

PostPosted: Wed Jun 01, 2011 10:10 am
by Richard Chidiak
Hello

oBrw:lExcelCellwise := .t.
OBRW:TOEXCEL()

makes the computer hang ,

This occurs since i updated to fwh 11.04

Using office 2010

Anyone else experiencing this ?

Thanks for the help

PS : resetting back my xbrowse.prg from fwh 10.10 (previous version i used) , it works as expected

Re: xbrowse to excel office 2010

PostPosted: Wed Jun 01, 2011 11:56 am
by nageswaragunupudi
May I know what version of Harbour / XHarbour (Free) / xHb commecial and the compiler are you using please?

Specifically, are you using xharbour commercial?

Re: xbrowse to excel office 2010

PostPosted: Wed Jun 01, 2011 12:11 pm
by Richard Chidiak
I am using bcc 5.82 and xharbour from fivetech version 1.2.1

Re: xbrowse to excel office 2010

PostPosted: Wed Jun 01, 2011 2:49 pm
by nageswaragunupudi
Can you please try this simple program and post the result here?
Code: Select all  Expand view
#include 'fivewin.ch'

function main()

   local oExcel

   msginfo( 'Before ExcelObj()' )
   oExcel   := ExcelObj()  // is the program hanging here?
   msginfo( 'After ExcelObj()' )
   msginfo( ValType( oExcel ), 'ValType of Object' )

return 0

Let us see if the program is hanging at this function call.

Note: I have only Office2007. Request you to help testing on Office2010

Re: xbrowse to excel office 2010

PostPosted: Wed Jun 01, 2011 3:02 pm
by Otto
Dear Mr. Rao,
your code is working fine here.
Richard, please have a look to:
viewtopic.php?f=3&t=18483&p=96817&hilit=office#p96817

Did you install Office as usual or did you use the Click-to-Run option?

Best regards,
Otto

Re: xbrowse to excel office 2010

PostPosted: Wed Jun 01, 2011 3:25 pm
by Richard Chidiak
Mr Rao,

   msginfo( 'Before ExcelObj()' )
   oExcel   := ExcelObj()  // is the program hanging here?

yes it is hanging here

If i can help further, let me know

I have put back my xbrowse.prg from fwh 10.10 and everything works as expected

Otto

I have complete office 2010 professional, and the problem occured when i upgraded from fwh 10.10 to 11.04

Richard

Re: xbrowse to excel office 2010

PostPosted: Wed Jun 01, 2011 3:41 pm
by nageswaragunupudi
This is working fine for Mr.Otto but not for you. The problem is not because of the version of Office.

Please open \fwh\source\function\olefuncs.prg.
First function is GetOleObject( cApp )
Code: Select all  Expand view

function GetOleObject( cApp )

   local oObj

   TRY
      oObj  := GetActiveObject( cApp )
   CATCH
      TRY
         oObj  := CreateObject( cApp )
      CATCH
      END
   END

return oObj
 

This function is reported to hanging with xHarbour commerical. Probably it may be hanging with your version of xHarbour too.

Please try substituing the function with the following function
Code: Select all  Expand view

function GetOleObject( cApp )

   local oObj

   TRY
      oObj  := TOleAuto():New( cApp )
   CATCH
   END

return oObj
 

Compile the program and link the object file with your above sample code.
Please let us know if the sample program is working or still hanging.

This work around solved the problem for some users.

Re: xbrowse to excel office 2010

PostPosted: Wed Jun 01, 2011 3:50 pm
by Richard Chidiak
It works ok with these changes

I do not update to xharbour's actual version because there is a bug with "copy to" and my application uses this syntax in some cases

Thanks for your help,

Re: xbrowse to excel office 2010

PostPosted: Wed Jun 01, 2011 4:09 pm
by nageswaragunupudi
Good to know.

Can you still help me more? It is desirable to know where exactly the code is hanging, so that we can think of a solution that works for all.

Can you substitute GetOleObject() function with this modification and see where it is failing or hanging?

Code: Select all  Expand view

function GetOleObject( cApp )

   local oObj

   TRY
      msginfo( 'Before GetActiveObject' )
      oObj  := GetActiveObject( cApp )
      msginfo( 'GetActiveObject() succeeded' )
   CATCH
      msginfo( 'GetActiveObject() failed' )
   END
   if oObj == nil  
      TRY
         msginfo( 'Before CreateObject()' )
         oObj  := CreateObject( cApp )
         msginfo( 'CreateObj() succeeded' )
      CATCH
         msginfo( 'CreateObj() failed' )
      END
   endf

return oObj
 


Once please test after booting computer.
Second time, first open Excel normally and then run the program while excel is still running.

I would be glad if you can post the test results.

Re: xbrowse to excel office 2010

PostPosted: Thu Jun 02, 2011 1:57 pm
by Richard Chidiak
Mr Rao

in both cases only one message, the very first one Before GetActiveObject

It is displayed for ever , like in an endless loop , i have to stop the program from the task manager

Hth

Regards,