DC_Aarray2Excel cancel button inoperative

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

DC_Aarray2Excel cancel button inoperative

#1 Post by GeneB »

The cancel button in the progress window for DC_Array2Excel does not terminate the process of building the spreadsheet.

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_Aarray2Excel cancel button inoperative

#2 Post by rdonnay »

Here is a fix.

Copy _DCFUNCT.PRG to your \exp19\source\dclipx folder.
Run BUILD19_SL1.BAT to rebuild DCLIPX.DLL
Attachments
_dcfunct.zip
(44.37 KiB) Downloaded 676 times
The eXpress train is coming - and it has more cars.

User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: DC_Aarray2Excel cancel button inoperative

#3 Post by GeneB »

Thanks, Roger, this destroys the dialog window.
But Excel is still running (oExcel not destroyed?).
The result is that the exe freezes until Excel is closed with 'task manager'.

Is it also possible to return .f. if lStatus = .f. to allow testing for a cancel?

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_Aarray2Excel cancel button inoperative

#4 Post by rdonnay »

I don't see anything wrong with the code.
Also, I am not having that problem when I test the code.

I am totally bombarded with stuff right now.
How about helping me out and debug the code?

You can put WTF's in the DC_Array2Excel() function and help figure out why you are having this problem.
The eXpress train is coming - and it has more cars.

User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: DC_Aarray2Excel cancel button inoperative

#5 Post by GeneB »

After much trial and error, if this line:

oBook:SaveAs(cExcelFile,xlWorkbookNormal,cPassword)

is bypassed after testing lStatus and getting .f.,
either oBook cannot be closed and destroyed or oExcel cannot be 'quit' or destroyed, can't tell which,
and this locks the exe.

The 'cancel' button now exits the spreadsheet build, but creates a partially built spreadsheet because must still 'SaveAs'. Exiting the function with .f. (lStatus) allows me to warn the user that it didn't complete and/or erase the partial spreadsheet.

When you are less bombarded, hope you can fix it. Not having a cancel button could, under certain circumstances, build a spreadsheet for days.

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_Aarray2Excel cancel button inoperative

#6 Post by rdonnay »

Comment out 3 lines of code starting at line 4995.
That will probably fix it.

Code: Select all

/*
IF !lStatus
  BREAK
ENDIF
*/
The eXpress train is coming - and it has more cars.

User avatar
GeneB
Posts: 158
Joined: Sun Jan 31, 2010 8:32 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: DC_Aarray2Excel cancel button inoperative

#7 Post by GeneB »

That's what I did.
And end the function with " Return lStatus " so you can test for an early exit.

Post Reply