Can i populate a spreadsheet using vbs and libre office?

Hello,

I have a VBS script (NOT VBA) written that reads a text file and then creates a spreadsheet in Excel and populates it. I would like to know if I could do the same thing with Libre Office. Can someone point me in the correct direction for documentation on this?

If you are willing to rewrite at least parts to use the LibreOffice API and document model then the answer most likely is “probably yes”. But of course we don’t know your script…

See API documentation and links to BASIC documentation.

Thank you for providing that information. Will start there

Please do not use the Answer field for comments that are not an answer to the original question, use add a comment instead. Thanks.

Deleting this answer and converting it to a comment instead would be welcome.

The following VBS script starts the LO Calc application and creates a new spreadsheet.
All that remains is to read the text file and populate the document… :slight_smile:

Option Explicit
Sub test
  Dim oSM, StarDesktop, oDoc 
   
  Set oSM = CreateObject("com.sun.star.ServiceManager")                
  Set StarDesktop = oSm.createInstance("com.sun.star.frame.Desktop")
  Set oDoc=StarDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, Array())   ' New Document 
  ' ...
End Sub

test