Issue 33021 - Excel VBA import filter
Summary: Excel VBA import filter
Status: CONFIRMED
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: current
Hardware: All All
: P3 Trivial with 2 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: oooqa
: 79107 (view as issue list)
Depends on:
Blocks:
 
Reported: 2004-08-16 09:52 UTC by tora3
Modified: 2017-05-20 11:29 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
A sample OOo Basic program that imports Excel VBA macros (10.96 KB, application/vnd.sun.xml.calc)
2004-08-16 09:55 UTC, tora3
no flags Details
A Perl script that helps the OOo Basic importer (4.36 KB, text/txt)
2004-08-16 09:57 UTC, tora3
no flags Details
A sample Excel document that includes custom functions in VBA and uses them in a sheet (19.50 KB, application/vnd.ms-excel)
2004-08-16 10:05 UTC, tora3
no flags Details
A snapshot that depicts an original Excel, a just loaded, and a converted document with their macros (341.79 KB, image/png)
2004-08-16 10:53 UTC, tora3
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description tora3 2004-08-16 09:52:07 UTC
Do you have any idea to make instructions of importing VBA a little bit easier?

Current instructions:
1 Loads a specified MS Excel file.
2 Saves it as "OpenOffice.org 1.0 Spreadsheet (.sxc)."
3 Close it.
4 Starts a helper Perl script to modify the sxc file.
   a Creates a temporary working directory in the directory /tmp.
   b Copies the sxc file to 'xxx.sxc.zip'.
   c Extracts contents of the file into the working directory with unzip command.
   d Removes an element named <table:named-expressions> from a file content.xml
   e Replaces "=(xxx)" with "=xxx()" in the file content.xml
   f Eliminates "Rem ", lines for "Sub" and "End Sub" statement from
Basic/xxx/yyy.xml
   g Packs contents back to 'xxx.sxc.zip' with zip command.
   h Renames the original file 'xxx.sxc' to 'xxx.bak.sxc'.
   i Renames the modified file 'xxx.sxc.zip' to 'xxx.sxc'.
   j Cleans up and removes the temporary working directory.    
5 Waits until termination of the Perl script.
6 Loads the modified file.
Comment 1 tora3 2004-08-16 09:55:55 UTC
Created attachment 17153 [details]
A sample OOo Basic program that imports Excel VBA macros
Comment 2 tora3 2004-08-16 09:57:38 UTC
Created attachment 17154 [details]
A Perl script that helps the OOo Basic importer
Comment 3 tora3 2004-08-16 10:03:28 UTC
To try the sample OOo Basic program that will import Excal VBA macros,
 - Prepare a Unix base machine. The program will not work on Windows.
 - Download Excel_VBA_Importer.sxc
 - Download Excel_VBA_Importer.pl
 - Open Excel_VBA_Importer.sxc and follow the instructions in it.
     - Choose an Excel file that you want to import.
     - Click on 'Load' button. 
 That's it. You would see a properly imported Excel document in the Calc.
Comment 4 tora3 2004-08-16 10:05:44 UTC
Created attachment 17155 [details]
A sample Excel document that includes custom functions in VBA and uses them in a sheet
Comment 5 tora3 2004-08-16 10:53:26 UTC
Created attachment 17157 [details]
A snapshot that depicts an original Excel,  a just loaded, and a converted document with their macros
Comment 6 oavaldez 2004-09-02 19:06:57 UTC
In order for the import filter to work, I had to manually remove the word
"Private" from all "Private Sub" statements in Excel_VBA_Importer.sxc (I would
get a "BASIC syntax error. Symbol expected" message with each).

After importing, the converted file's macros also give me the same error on
every "Private Sub" statement.

My experience programming macros is next to nil, so the solution to this problem
is probably very simple.
Comment 7 Mathias_Bauer 2005-03-31 15:22:07 UTC
Sorry, but could you please explain what you want us to do here?
There is a reason that the VBA code is commented out: it does not work in OOo,
and OOo is an end user application, so we will not import any macro code that
does not run.
Comment 8 utomo99 2005-04-04 11:51:43 UTC
Tora, regarding the VBA, look at Issue 27344. 
but it use different solutions. 
maybe you can help the sheet name problems. 
thanks

Comment 9 tora3 2005-04-04 15:46:43 UTC
Hmm, leave this for me for a while. 

One thing that i cannot understand is that the names of user defined functions 
prepared in Excel seem not to be used in OOo 1.1.x. They are already declared 
as another identifier when the Excel file is imported to OOo. Why?

Comment 10 mbayer 2007-07-02 23:47:13 UTC
*** Issue 79107 has been marked as a duplicate of this issue. ***
Comment 11 utomo99 2007-07-03 09:31:16 UTC
I add michael meek at CC, I think he will interest in this
Comment 12 mmeeks 2007-07-03 23:47:32 UTC
Thanks utomo for the link; this looks 'amazing' ;-) hopefully the built-in
import [ available for ages on Linux, or Novell/OO.o/Win32 ] will be rather better.

Noel ?
Comment 13 utomo99 2007-07-04 06:33:49 UTC
@ Michael: your welcome michael.

@Noel
I hope Noel will consider this for OOo 2.3
as the patch is there.

@Tora, I see the OS is ALL, but at the 
Aug 16 09:03:28 +0000 2004  you say
The program will not work on Windows.

I hope it is for all OS. 

Thanks all. 

Comment 14 Marcus 2017-05-20 11:29:53 UTC
Reset assigne to the default "issues@openoffice.apache.org".