Bug 51884 - "ThisWorkbook" causes BASIC runntime error:423
Summary: "ThisWorkbook" causes BASIC runntime error:423
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-09 04:41 UTC by hmoi
Modified: 2013-06-26 08:15 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
sample excel file with vba macro (22.00 KB, application/ms-excel)
2012-07-09 04:41 UTC, hmoi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hmoi 2012-07-09 04:41:37 UTC
Created attachment 63996 [details]
sample excel file with vba macro

LibreOffice 3.5.4.2
WindowsXP SP3 


Steps to reproduce:
1. Open "sample1.xls" file with calc
2. Click "Enable Macros" 
3. Select Tools -> Macros -> Run Macro , then open Macro Selector Dialog
4. Select sample.xls -> VBAProject -> Module1 -> Main, and then click "Run"

Behavior 1: Selected "Sheet3" normaly

5. Continuously, select File -> SaveAs, and save as "ODF spreadsheet (.ods)"  file type
   For example, the name is "sample.ods"
6. Select Tools -> Macros -> Run Macro , then open Macro Selector Dialog
7. Select sample.xls -> VBAProject -> Module1 -> Main, and then click "Run"

Behavior 2: Selected "Sheet3" normaly.

8. Close Calc.
9. Select File -> Open -> "sample.ods"
10. Select Tools -> Macros -> Run Macro , then open Macro Selector Dialog
11. Select sample.xls -> VBAProject -> Module1 -> Main, and then click "Run"

Behavior 3: Error message pops up
              BASIC runtime error.
              '423'
              Worksheets

Expected results: even in ods file, Selected "Sheet3" in the same way as Behavior 1 and 2.


I suspect it's because of "ThisWorkbook" collision within both Module name and code statement, in the case of ODS file.
When I remove module:"ThisWorkbook" from sample.ods, "Sheet3" selected in the same way as Behavior 1 and 2.

Best Regards,
Hirono
Comment 1 Joel Madero 2013-06-26 04:52:15 UTC
Noel - one for you?
Comment 2 Noel Power 2013-06-26 08:15:28 UTC
VBA for Excel interoperabily support works optimally when run within a native excel document. The api implementation depends on relationships and data ( some of which are faked or synthesised ) read and built on import, when saved as ods all bets are off, some things ( especially Sheet/Document etc. specific Modules ) will not work, others continue to work.
Libreoffice basic and the libreoffice uno api is what's supported in ods documents. Sorry, that's by design and there is currently no plan to make the VBA api support more generally available.