We still have a conversion tool running on an old system that creates xls files which are in fact the old Lotus wk1 format.
Openoffice scalc is able to open them, but I've a problem in batch mode using a macro
As users can no longer open these files in Excel 2007 I'm just trying to put in place a script that would call an OOo basic macro to convert them in a more recent Excel format.
I'm using the macro below that work fine for other formats but have an issue to open wk1
Any help much appreciated .. should I use a filter .. and if yes which one?
Thanks
TV
Sub convrt( cFile )
Dim adresseDoc As String
Dim propFich()
Dim oDoc()
cURL = ConvertToURL( cFile )
oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, (Array(MakePropertyValue( "Hidden", True ),))
cFile = Left( cFile, Len( cFile ) - 4 ) + ".xls"
cURL = ConvertToURL( cFile )
oDoc.storeToURL( cURL, Array(MakePropertyValue( "Hidden", False ),_
MakePropertyValue( "AsTemplate", False ),_
MakePropertyValue( "FilerName", "MS Excel 97" ) ) )
oDoc.close( True )
End Sub
'----------
' Create and return a new com.sun.star.beans.PropertyValue.
'
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function
Opening/importing wk1 files in macro?
Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Return to “Macros and UNO API”
Jump to
- Getting started
- ↳ Survival guide
- ↳ Beginners
- ↳ Getting Started Guide for 4.x
- ↳ Getting Started Guide for 3.x
- ↳ Install, Setup and Troubleshooting
- ↳ Admin Guide
- ↳ MS Windows
- ↳ Linux
- ↳ Mac OSX
- ↳ LibreOffice
- ↳ Tablets
- ↳ Tutorials
- ↳ Writer
- ↳ Calc
- ↳ Base
- Applications
- ↳ Writer
- ↳ Writer Guide for 4.x
- ↳ Writer Guide for 3.x
- ↳ Writer Tutorials
- ↳ Templates
- ↳ Advanced Uses
- ↳ Calc
- ↳ Calc Guide for 4.x
- ↳ Calc Guide for 3.x
- ↳ Calc Functions
- ↳ Calc Tutorials
- ↳ Impress
- ↳ Impress Guide for 4.x
- ↳ Impress Guide for 3.x
- ↳ Draw
- ↳ Draw Guide for 4.x
- ↳ Draw Guide for 3.x
- ↳ Math
- ↳ Math Guide for 4.x
- ↳ Math Guide for 3.x
- ↳ Math Guide for 3.x
- ↳ Base
- ↳ Base Guide for 4.x
- ↳ Wiki
- ↳ Base Tutorials
- ↳ Tables & Queries
- ↳ Forms
- ↳ External Data Sources
- ↳ Reporting
- ↳ Database Examples
- Customizing and Extending
- ↳ Macros and UNO API
- ↳ Basic Guide
- ↳ Code Snippets
- ↳ Extension Repository
- ↳ Macro Repository
- ↳ External Programs
- ↳ Extensions
- ↳ Extensions page
- Community
- ↳ General Discussion
- ↳ Site Feedback
- ↳ Forum Governance
- ↳ User Experience (UX)
- ↳ Announcements
- Business
- ↳ Institutions & Educational
- ↳ Paid support
- ↳ Consultants Directory