Ivaylo Stanchev
-
Posts
14 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Posts posted by Ivaylo Stanchev
-
-
Hi,
Because of the two Excel file formats - XLSX and XLS, there are two different programing codes for each of the formats. To know which one to execute we need to know the extension or the whole name of the file. Assuming that anyway, the user will know the full name ( hardcoded or taken from file chooser) we decided to use EXL_NewBook(filePath) instead of EXL_NewBook(fileExtension).
EXL_NewBook(filePath) returns TRUE because the initial XLS or XLSX code was successfully executed. But the real file is created only after calling EXL_SaveAndCloseBook(filePath).
Technically, an empty string could be used in EXL_NewBook(''). In this case, the "XLSX" code will be executed by default. But if at the end, the book is saved and closed as "*.XLS", the file extension will differ from the file format. And an error will appear when opening this file using the Excel application.
Here is a short script example. I hope you find it useful.
PROCEDURE TestExcel; VAR newname : STRING; res : BOOLEAN; shNum : INTEGER; BEGIN newname:= 'C:\\Temp\\Test.xlsx'; res := EXL_NEWBOOK(''); res := EXL_ADDSHEET('NEW_SHEET'); res := EXL_GETSHEETINDEX('NEW_SHEET',shNum); IF ( res = TRUE) THEN BEGIN res := EXL_SETCELLSTRING(shNum,0,0,newname); END; res := EXL_SAVEANDCLOSEBOOK(newname); END; Run(TestExcel);
Best regards,
Ivaylo.
-
@SLFY Hi,
Here is the list of supported functions. Means that they should be translated well form Excel to Vectorworks and vice versa.
Named ranges are not supported yet. And the sheet referencing also is not supported for now. Therefore if you import cell "=SUM(MyRange)" it will be placed in the Vectorworks the same way. And thus "=SUM(MyRange)" will show an #VALUE! error.
Thanks,
Ivaylo.
- 1
-
It's not a bad idea. I'll think about it. But what about the name of the exported excel file?
-
Hi @WhoCanDo ,
About the
10 hours ago, WhoCanDo said:Response := StrDialog ('Search Data filename:', Concat (SearchDataPath, FName));
ShowWS (GetObject ('Search Data'), True);
DoMenuTextByName ('Export Worksheet', 0);
ShowWS (GetObject ('Search Data'), False);I'm attaching a video. Can you please look at it and tell me what is wrong there? I don't argue. I'm just trying to understand.
Also, what WSExport (WSName : string; Tab, All Rows, Recalc, Open : boolean) should do? Do you mean it should launch the export dialog, with name and settings according to the parameters, i.e. to substitute DoMenuTextByName ('Export Worksheet', 0)?
Thank you,
Ivaylo.
-
On 10/5/2020 at 10:28 AM, WhoCanDo said:
However, VW2021 has a tick box that defaults to "Open file in default viewer".
If you are using SP2 this should work for you. I just tested with a SP1 and a SP2 builds.
If you are using SP2 and this still does not work, please let me know.
Thank you,
Ivaylo.
Exporting Worksheet to .xlsx bug
in Troubleshooting
Posted
Hi @Matt Strong
Could you attach a Vectorwoks file that contains the worksheet named "IG PANEL....", in order to reproduce the issue?
Thank you,
Ivaylo.