I am using the automation bridge to interface my application to OpenOffice 
(ver 2.3.1).
The OS platform is Windows XP.
I can create a spreadsheet, populate it with data and save it to a file.
However, when I try to open an existing spreadsheet, amend it, then save it, 
I encounter an error on the store.
The error is reported as com.sun.star.task.ErrorCodeIOException.
I have reproduced the problem in some very simple vb scripts.
The following vbscript works fine to create and save a spreadsheet document 
to c:\temp\test.ods

   option explicit
   dim args()
   dim oDesktop
   dim oSvcMgr
   dim oDoc
   dim oSheet
   dim oCell
   dim row
   dim col

   set oSvcMgr = wscript.CreateObject("com.sun.star.ServiceManager")
   set oDesktop = oSvcMgr.createInstance("com.sun.star.frame.Desktop")
   set oDoc = oDesktop.loadComponentFromURL("private:factory/scalc", 
"_blank", 0, args)
   set oSheet = oDoc.getSheets.getByIndex(0)
   row = 0
   col = 0
   set oCell = oSheet.getCellByPosition(col, row)
   oCell.Value = 123
   oDoc.storeAsURL "file:///c:/temp/test.ods",args

This vbscipt then demonstrates the problem:

   option explicit
   dim args()
   dim oDesktop
   dim oSvcMgr
   dim oDoc
   dim oSheet
   dim oCell
   dim row
   dim col

   set oSvcMgr = wscript.CreateObject("com.sun.star.ServiceManager")
   set oDesktop = oSvcMgr.createInstance("com.sun.star.frame.Desktop")
   set oDoc = oDesktop.loadComponentFromURL("file:///c:\temp\test.ods", 
"_blank", 0, args)
   set oSheet = oDoc.getSheets.getByIndex(0)
   row = 1
   col = 1
   set oCell = oSheet.getCellByPosition(col, row)
   oCell.Value = 456
  oDoc.store

If I use the 'save' button on the OpenOffice GUI to try to save the 
document, I get exactly the same problem:

   Error saving the document C:\temp\test:
   General Error.
   General input/output error

I use the OpenOffice GUI to open, update and save c:\temp\test.ods it works 
fine, so there is nothing 'wrong' with the document.

Can anyone tell me what I'm doing wrong, please? 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to