vbscript та openoffice calc


Warning: sizeof(): Parameter must be an array or an object that implements Countable in /var/www/clients/client1/web1/web/wp-content/plugins/ad-injection/ad-injection.php on line 824

Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/clients/client1/web1/web/wp-content/plugins/ad-injection/ad-injection.php on line 831

Приклад того, як можна дістати дані з openoffice calc документа за допомогою vbscript


Set objServiceManager= WScript.CreateObject(
                                   "com.sun.star.ServiceManager"
                                         ) 
Set StarDesktop= objServiceManager.createInstance(
                                   "com.sun.star.frame.Desktop"
                                        ) 
cURL = "File:///c:/test.sxc" 
set oDoc = StarDesktop.loadComponentFromURL(
                                    cURL, "_blank", 0, Array() 
                                       ) 
set oSheet = oDoc.getSheets().getByName( "Sheet1" ) 
set oCell = oSheet.getCellByPosition( 0, 1 ) 
nValue = oCell.getValue() 
msgbox nValue