I’m working with a sheet where I’ve configured a button with a Macro to delete some headers and export the .xlsm
to .csv
format.
The Macro works fine but I’m aware most people using our App will be using MS Excel, so I’m wondering if there’s any way to make my Macro compatible between the two or if I should use different files with different syntaxes for each operating system / calc App.
This is the Macro:
REM ***** BASIC *****
Sub DeleteEntireRow()
Dim oActiveSheet as Object
oActiveSheet = ThisComponent.getCurrentController.getActiveSheet()
oActiveSheet.getRows.removeByIndex( 0, 1 )
StoreCSV()
End Sub
sub StoreCSV()
dim sURL As String
dim document as object
document = ThisComponent
sURL = ThisComponent.getURL()
sURL = sURL &"_"& s &".csv"
dim args(1) as new com.sun.star.beans.PropertyValue
args(0).Name = "FilterName"
args(0).Value = "Text - txt - csv (StarCalc)"
args(1).Name = "FilterOptions"
args(1).Value = "44,34,76,1"
document.storeToURL(sURL,args)
end sub