Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VfpxWorkBookXlsx
Message
 
 
To
06/10/2020 13:36:39
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01676306
Message ID:
01676491
Views:
38
>>>>Could you please explain something. When I export a cursor to an XLSX file and specify a file that does not exist (e.g. "TEST1234"), I get a messagebox "sheet already exists, overwrite it?". I don't recall getting this question with the previous version of your library. Also, if I answer, No, the method WriteWorkBookXml goes to Catch To loException. And there is a SET STEP ON in the code. But mainly, why the question on a completely new XLSX file?
>>>
>>>I searched my class code for "message" and "exist" but do not have any 'hits' that have this message text. The class does not provide any message text on its own; all the messages of possible error/warning conditions is raised as an Event via RAISEEVENT command calling the OnShowErrorMessage event. You would have to implement the code in OnShowErrorMessage to display text. So I am guessing that you implemented this method; so can you tell me from where in the code it is being raised so that I can look into this? Also, what is the text that is given by loException.Message at the CATCH statement? In the loop for writing the sheet(s) to be added to the XML there is a THROW command if the sheet is not found in the xl_sheets cursor -- is this where the exception is occurring? Can you provide example code to reproduce the error?
>
>>I get this messagebox on this line:
>
>loExcel = NEWOBJECT("VFPxWorkbookXLSX", "VFPxWorkbookXLSX.vcx")
>
>
>>In the debugger this line is where the messagebox pops up:
>
>this.CreateWorkingCursors()
>
>
>>And then inside the .CreateWorkingCursor() the line:
>
>INDEX ON BINTOC(workbook)+BINTOC(sheet) TAG sheet FOR !DELETED()
>
>
>From the above it looks like you might be creating two instances of the class in the same data environment. The first instance creates the cursors in the Init() event of the class by calling the protected method CreateWorkingCursors(). All is well. Then you create a second instance and the Init() again calls the CreateWorkingCursors() method but this time the cursors exists and the code complains at the statement shown above (I am not sure why it would not have complained sooner). But this is what I can best tell.
>
>I tried to reproduce this error by doing a SQL SELECT on a table to create a cursor and then create a workbook from the cursor. My test completed successfully. I can also create a workbook from a table without problems. So I have not been able to reproduce the error. Are you sure you are starting with a clean data environment and a single instance of the class in the data environment? Try modifying the form attached to use your table/cursor. See if this works.

I don't use data environment. I create the object loExcel in code (just like I showed above). And I checked my code, I only have one line:
loExcel = NEWOBJECT("VFPxWorkbookXLSX", "VFPxWorkbookXLSX.vcx")
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform