Hello Guys,
I am using macro in libreoffice , I need some requirement to open .CSV file in macro coding , and I could it . Now these time I need to open MS Excel file as a input ,
and I don’t know how to open it in macro coding
here I paste coding of open file of .CSV
Sub TestMacro
Dim oDocument as Object
FName="D:\Projects\Input_file"
fnURL=ConvertToURL(FName+".csv")
'Create new document and import data'
oDocument = StarDesktop.LoadComponentFromURL( fnURL, "_blank", 0, _
Array(MakePropertyValue( "FilterName", "Text - txt - csv (StarCalc)" ), _
MakePropertyValue( "FilterOptions", "59/9,34,0,1,1/1/1/1/1/1/1/1" )
'property function'
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
oPropertyValue = createUnoStruct( "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
Now anybody can figure it out that How can open Excel file instead of CSV file
then let me know
Thnks
Lion