Forum Discussion

Deimos's avatar
Deimos
Occasional Visitor
5 years ago
Solved

Trying to write in a LibreOffice Calc document With OleObject

Hello!

 

I'm trying to write in a xls doc with LibreOffice, using TestComplete, but I'm having an error message like that:

 

"[automation bridge] UnoConversionUtilities<T>::dispatchExObject2Sequence \nConversion of dispatch object to Sequence failed!"

 

The Javascript code is:

 

function Main() {
try{
  var oServiceManager = Sys.OleObject("com.sun.star.ServiceManager");
  
  var oDesktop = oServiceManager.createInstance("com.sun.star.frame.Desktop");
  
  var VariantArray = new Array();
  
  var myStruct = oServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue");
  
  myStruct.Name = "Hidden";
  
  myStruct.Value = true;
  
  VariantArray[0] = myStruct;
  
  var oDoc = oDesktop.LoadComponentFromURL("private:factory/scalc", "_blank", 0, VariantArray);
  
  var oSheet = oDoc["getSheets"]().getByIndex(0);
  
}catch(e){
  Log.Error(e);
}

}

In this line  var oDoc = oDesktop.LoadComponentFromURL("private:factory/scalc", "_blank", 0, VariantArray); I'm having this problem.

Please, Help me!

2 Replies