<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Javacioc</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Javacioc"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Javacioc"/>
	<updated>2026-10-10T19:59:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Spreadsheets/Example:_Adding_a_New_Spreadsheet&amp;diff=146810</id>
		<title>Talk:Documentation/DevGuide/Spreadsheets/Example: Adding a New Spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Spreadsheets/Example:_Adding_a_New_Spreadsheet&amp;diff=146810"/>
		<updated>2009-11-15T22:40:13Z</updated>

		<summary type="html">&lt;p&gt;Javacioc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the insertSpreadsheet() method of the example, the assignement&lt;br /&gt;
 &lt;br /&gt;
 xSheet = xSheets.getByName(aName);&lt;br /&gt;
 &lt;br /&gt;
cannot be casted to com.sun.star.sheet.XSpreadsheet as per Exception reported as follow:&lt;br /&gt;
 &lt;br /&gt;
 java.lang.ClassCastException: com.sun.star.uno.Any cannot be cast to com.sun.star.sheet.XSpreadsheet&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
As per the API, the method [http://api.openoffice.org/docs/common/ref/com/sun/star/container/XNameAccess.html#getByName getByName] returns com.sun.star.uno.Any as data type.&lt;br /&gt;
&lt;br /&gt;
I think it should:&lt;br /&gt;
  &lt;br /&gt;
 xSheet = (XSpreadsheet) UnoRuntime.queryInterface(XSpreadsheet.class, xSheets.getByName(aName));&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m using Netbeans 6.7.1 with OpenOffice.org API Plugin v.2.0.6, the SDK is 3.1.1&lt;br /&gt;
&lt;br /&gt;
--[[User:Javacioc|Javacioc]] 22:13, 15 November 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Javacioc</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=User:Javacioc&amp;diff=146807</id>
		<title>User:Javacioc</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=User:Javacioc&amp;diff=146807"/>
		<updated>2009-11-15T22:33:40Z</updated>

		<summary type="html">&lt;p&gt;Javacioc: Created page with &amp;#039;My profile on [http://it.linkedin.com/in/javacioc Linkedin]&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My profile on [http://it.linkedin.com/in/javacioc Linkedin]&lt;/div&gt;</summary>
		<author><name>Javacioc</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Spreadsheets/Example:_Adding_a_New_Spreadsheet&amp;diff=146806</id>
		<title>Talk:Documentation/DevGuide/Spreadsheets/Example: Adding a New Spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Spreadsheets/Example:_Adding_a_New_Spreadsheet&amp;diff=146806"/>
		<updated>2009-11-15T22:14:50Z</updated>

		<summary type="html">&lt;p&gt;Javacioc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the insertSpreadsheet() method of the example, the assignement&lt;br /&gt;
 &lt;br /&gt;
 xSheet = xSheets.getByName(aName);&lt;br /&gt;
 &lt;br /&gt;
cannot be casted to com.sun.star.sheet.XSpreadsheet as per Exception reported as follow:&lt;br /&gt;
 &lt;br /&gt;
 java.lang.ClassCastException: com.sun.star.uno.Any cannot be cast to com.sun.star.sheet.XSpreadsheet&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
As per the API, the method [http://api.openoffice.org/docs/common/ref/com/sun/star/container/XNameAccess.html#getByName getByName] returns com.sun.star.uno.Any as data type.&lt;br /&gt;
&lt;br /&gt;
I found the way on getting the right Interface reading the [http://www.javaworld.com/javaworld/jw-05-2008/jw-05-spreadsheets.html?page=2http://www.javaworld.com/javaworld/jw-05-2008/jw-05-spreadsheets.html?page=2 JavaWorld article] and it works well.&lt;br /&gt;
&lt;br /&gt;
Here the snippet:&lt;br /&gt;
 &lt;br /&gt;
 xSheet = (XSpreadsheet) UnoRuntime.queryInterface(XSpreadsheet.class, xSheets.getByName(aName));&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m using Netbeans 6.7.1 with OpenOffice.org API Plugin v.2.0.6, the SDK is 3.1.1&lt;br /&gt;
&lt;br /&gt;
--[[User:Javacioc|Javacioc]] 22:13, 15 November 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Javacioc</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Spreadsheets/Example:_Adding_a_New_Spreadsheet&amp;diff=146805</id>
		<title>Talk:Documentation/DevGuide/Spreadsheets/Example: Adding a New Spreadsheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Spreadsheets/Example:_Adding_a_New_Spreadsheet&amp;diff=146805"/>
		<updated>2009-11-15T22:13:27Z</updated>

		<summary type="html">&lt;p&gt;Javacioc: Created page with &amp;#039;In the insertSpreadsheet() method of the example, the assignement    xSheet = xSheets.getByName(aName);   cannot be casted to com.sun.star.sheet.XSpreadsheet as per Exception rep…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the insertSpreadsheet() method of the example, the assignement&lt;br /&gt;
 &lt;br /&gt;
 xSheet = xSheets.getByName(aName);&lt;br /&gt;
 &lt;br /&gt;
cannot be casted to com.sun.star.sheet.XSpreadsheet as per Exception reported as follow:&lt;br /&gt;
 &lt;br /&gt;
 java.lang.ClassCastException: com.sun.star.uno.Any cannot be cast to com.sun.star.sheet.XSpreadsheet&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
As per the API of the method [http://api.openoffice.org/docs/common/ref/com/sun/star/container/XNameAccess.html#getByName getByName] the method returns com.sun.star.uno.Any as data type.&lt;br /&gt;
&lt;br /&gt;
I found the way on getting the right Interface reading the [http://www.javaworld.com/javaworld/jw-05-2008/jw-05-spreadsheets.html?page=2http://www.javaworld.com/javaworld/jw-05-2008/jw-05-spreadsheets.html?page=2 JavaWorld article] and it works well.&lt;br /&gt;
&lt;br /&gt;
Here the snippet:&lt;br /&gt;
 &lt;br /&gt;
 xSheet = (XSpreadsheet) UnoRuntime.queryInterface(XSpreadsheet.class, xSheets.getByName(aName));&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m using Netbeans 6.7.1 with OpenOffice.org API Plugin v.2.0.6, the SDK is 3.1.1&lt;br /&gt;
&lt;br /&gt;
--[[User:Javacioc|Javacioc]] 22:13, 15 November 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Javacioc</name></author>
	</entry>
</feed>