Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2008, 02:33 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default Excel.

Hi,

Hi,

I have this scenario:

I have 3 programs Progrm1, MS Excel, and myprogram. The excel sheet reads from the first Progrm1 (Hyperlinks) and myprogram reads from the excel sheet. Currently I get errors like "The Call was rejected by the calee" and some other errors. Is there any way to make this scenario possible?

Regards,
Abdulaziz Jasser
Reply With Quote
  #2  
Old 06-01-2008, 11:13 AM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: Excel.

Try to disable the antivirus in Windows

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #3  
Old 06-01-2008, 11:28 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default RE: Excel.

It is already off.

Regards,
Abdulaziz Jasser
Reply With Quote
  #4  
Old 06-01-2008, 10:47 PM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: Excel.

Can you show your code which fails with this error?
Do you run some macros?

PS: this error raised only if MS Excel is busy but in same time you sent some command to execute from ole-automation.


With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #5  
Old 06-02-2008, 05:12 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default RE: Excel.

Thanks Mike for replying,

Again, I will try to explain things: My program start MS Excel (Hidden) with a document that has hyperlinks to another third-party program. The Excel document reads data through those hyperlinks and my program read from that document. I will send you the Excel document.

Regards,
Abdulaziz Jasser
Reply With Quote
  #6  
Old 06-02-2008, 05:12 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default RE: Excel.

Thanks Mike for replying,

Again, I will try to explain things: My program start MS Excel (Hidden) with a document that has hyperlinks to another third-party program. The Excel document reads data through those hyperlinks and my program read from that document. I will send you the Excel document.

Regards,
Abdulaziz Jasser
Reply With Quote
  #7  
Old 06-02-2008, 05:16 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default RE: Excel.

Could you send your email so I can email you the excel document?

Regards,
Abdulaziz Jasser
Reply With Quote
  #8  
Old 06-02-2008, 06:37 AM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: Excel.

Better to show your code (ole-automation).
As I described before, seems you send some command from code until xls-file loading is finished or Excel do some calculations in background.
Or Excel read the external data and in same time you sent some command etc

So problem is not in xls-file. Problem is in your code

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #9  
Old 06-02-2008, 07:50 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default RE: Excel.

The problem occurs only if the third-party program is running. Here is my code:

[DELPHI]oExcel := TExcelApplication.Create(Application);

try
oExcel.Visible[0] := False;
oExcel.Calculate(0);
// oExcel.CalculateFull;
// oExcel.CalculateFullRebuild;
oExcel.DisplayAlerts[0] := False;
// oExcel.DisplayInfoWindow := False;
// oExcel.DisplayNoteIndicator := False;
oExcel.AlertBeforeOverwriting[0] := False;
oExcel.Connect;
except
Showmessage('Excel Is Not Installed');
exit;
end;

oExcel.EnableEvents := True;

// oExcel.ini

oExcel.Workbooks.Add(sExcelData,0);


// Sleep(2000);

oSheet := oExcel.Workbooks[1].Worksheets['Sheet1'];

cBid := StrToFloat(oSheet.Cells[r,10]);//HERE IS THE PROBLEM.
cLastClose := StrToFloat(oSheet.Cells[r,6]);[/DELPHI]

Regards,
Abdulaziz Jasser
Reply With Quote
  #10  
Old 06-02-2008, 07:52 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default RE: Excel.

The problem occurs only if the third-party program is running and excel is reading from it while my program is reading from excel. Here is my code:

Regards,
Abdulaziz Jasser
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 12:27 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.