Page 1 of 1

DC_Aarray2Excel cancel button inoperative

Posted: Thu Apr 16, 2015 5:35 pm
by GeneB
The cancel button in the progress window for DC_Array2Excel does not terminate the process of building the spreadsheet.

Re: DC_Aarray2Excel cancel button inoperative

Posted: Thu Apr 16, 2015 6:55 pm
by rdonnay
Here is a fix.

Copy _DCFUNCT.PRG to your \exp19\source\dclipx folder.
Run BUILD19_SL1.BAT to rebuild DCLIPX.DLL

Re: DC_Aarray2Excel cancel button inoperative

Posted: Thu Apr 16, 2015 9:35 pm
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?

Re: DC_Aarray2Excel cancel button inoperative

Posted: Fri Apr 17, 2015 3:56 am
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.

Re: DC_Aarray2Excel cancel button inoperative

Posted: Fri Apr 17, 2015 7:47 am
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.

Re: DC_Aarray2Excel cancel button inoperative

Posted: Fri Apr 17, 2015 8:07 am
by rdonnay
Comment out 3 lines of code starting at line 4995.
That will probably fix it.

Code: Select all

/*
IF !lStatus
  BREAK
ENDIF
*/

Re: DC_Aarray2Excel cancel button inoperative

Posted: Fri Apr 17, 2015 4:00 pm
by GeneB
That's what I did.
And end the function with " Return lStatus " so you can test for an early exit.