[Solved] Save a ods spreadsheet with API - complicated?
Posted: Mon Sep 16, 2019 4:14 pm
I've written a program in Autohotkey, that opens a blank spreadsheet, then fills cells with content. (and it works)
Now I want to save this spreadsheet to a name that exists in some cells with the same program.
The path => C3 (c:\temp) the filename => C4 (Test.ods)
I tried with this codeIt seams to work, but when I want to use I got an error or
Both tests give the same error
How to save the unnamed spreadsheet to the hard drive?
Now I want to save this spreadsheet to a name that exists in some cells with the same program.
The path => C3 (c:\temp) the filename => C4 (Test.ods)
I tried with this code
Code: Select all
sPath := oDoc.getSheets.getByName(SheetName).getCellRangeByName("C3").getString
sFileName := oDoc.getSheets.getByName(SheetName).getCellRangeByName("C4").getString
Code: Select all
sSaveToURL := ConvertToURL(sPath & sFileName)
Skipped the conversion and did the following steps .:Error: Call to nonexistent function.
Specifically: ConvertToURL(sPath & sFileName)
Code: Select all
sSaveToURL := "file:///c:/temp/Test.ods" ; Windows "c:\Temp\Test.ods"
oDoc.storeToUrl(sSaveToURL, Array(MakePropertyValue(oSM, "FilterName", "Calc8")))
Code: Select all
oDoc.storeToURL("file:///c:/temp/Test.ods", Array())
I don't know if "FilterName" and "Calc8" are correct (I have no idea what else can be in this fields)Error: 0x80020005 - Typmatchningsfel.
Specifically: storeToURL
How to save the unnamed spreadsheet to the hard drive?