I've searched all over the net for something that could help me but I couldn't find what I was looking for. I'm really new to vbscript coding and I was successful at finding the part where I could use vbscript to open an open office file and then modify it.
However, I badly need help in the SaveAs part. I know SaveAs only works in Excel applications but I'm wondering if there is some sort of equivalent for that for OpenOffice. I found a code (seen below) but it didn't work. The error said
.Type mismatch: 'objFile.StoreToURL'
Code: Select all
Set oSM = CreateObject("com.sun.star.ServiceManager") 'opening open office file
Set oDesk = oSM.createInstance("com.sun.star.frame.Desktop")
Set objFile = oDesk.loadComponentFromURL("file:///C:\sample.ods", "_default", 0, array())
objFile.getCellByPosition(0,1).setValue(123456) 'for sample only
objFile.getCellByPosition(6,4).setValue(77777) 'for sample only
Call ObjFile.StoreToURL("file:///c:/sample1.ods", args) 'saving ods file and then closing it after modifications
'Closing the document.
objFile.Close (True)
Set objFile = Nothing