1. Thorsten Kummer
  2. PowerBuilder
  3. Monday, 10 February 2020 14:10 PM UTC

Hi folks,

 

On one of our client computers the OLE to Excel crashes.

While the statement:

li_rc = myoleobject.ConnectToNewObject ("Excel.Application")

works fine, al later call to open an excel file crashes

myoleobject.workbooks.Open (ls_filename) 

"error calling external object function open...."

I assume the OLE configuration/registration has been damaged. Repairing/re-Installing of Excel did not help.

the file to open has been saved in an  APPDATA sub-directory. It exists and can later be opened with a standalone Excel (without using OLE),

 

Thanks in advance for your suggestions
Thorsten

 

 

 

 

Michael Kramer Accepted Answer Pending Moderation
  1. Tuesday, 11 February 2020 15:22 PM UTC
  2. PowerBuilder
  3. # 1

Hi Thorsten,

somehow this machine behaves differently than other client machines. Could be machine setup including which versions of Excel have been installed over time and therefore left traces in Windows registry.

Sometimes machines are absolutely identical but differ because user's access rights differ. - or regional settings differ; sometimes because a user has modified her/his personal settings so they don't match standard settings. Like US settings but different decimal separator.

I'm curious to what order of user tasks makes the Excel calls fail. Which of following sequences works fine?

  1. First > open app;
    Then > open this particular Excel file from app?
  2. First >open app;
    Then > open different Excel file from app?
  3. First > open app;
    Then > create this Excel file from app;
    Next > open this particular Excel file from app?
  4. First > open app;
    Then > create this Excel file from app;
    Next > open different Excel file from app?
  5. First > open app;
    Then > create different Excel file from app;
    Next > open any Excel file from app?
  6. First > open app;
    Then > create different Excel file from app;
    Next > open this particular Excel file from app?
  7. For any scenario that fails
    1. Different user on same machine?
    2. Same user on different machine?

I guess you see the divide-and-conquer to understand what sequence of events is the culprit. That helps identify cause of error and therefore solution.

Good luck, Thorsten!

/Michael

Comment
There are no comments made yet.
Thorsten Kummer Accepted Answer Pending Moderation
  1. Tuesday, 11 February 2020 06:11 AM UTC
  2. PowerBuilder
  3. # 2

Hello Chris,

 

1. no, it destroys the myoleobject without calling DisconnectObject

2. yes

 

I forgot to mention: the error appears only on a single computer of our company,all other work fine.

Even on this computer it worked fine for a while. It stopped to work immediately. The user told me that it happened after the 3rd time the functionality was executed. She was connected via VPN to our companie's network at this time.

I was told that there is "no differnce between all company computers", however.

I'll give it a try with DisconnectObject. And inform you.

Best regards

Thorsten

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 11 February 2020 19:09 PM UTC
Then I would suggest ...

1) Only Connect once to Excel in your App and then Disconnect & destroy *only* upon App exit.

2) Use the Open & Close as long as the PB App continues to run.

Food for thought.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 10 February 2020 20:24 PM UTC
  2. PowerBuilder
  3. # 3

Hi Thorsten;

1)  Does your PB Application Close the EXCEL session after each conversation?

2)  Does your PB App perform a "ConnectToNewObject " for each processing thread to Excel?

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.