<?xml version="1.0" encoding="utf-8"?><!-- generator="b2evolution/7.1.5-stable" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>OpenOffice Calc - Latest Comments on Utilizar una función de Calc desde una macro</title>
		<link>https://blog.open-office.es/calc/?disp=comments</link>
		<atom:link rel="self" type="application/rss+xml" href="https://blog.open-office.es/calc/?tempskin=_rss2&#38;disp=comments&#38;p=219" />
		<description></description>
		<language>es-ES</language>
		<docs>http://backend.userland.com/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=7.1.5-stable"/>
		<ttl>60</ttl>
		<item>
			<title> Joey [Visitante] in response to: Utilizar una función de Calc desde una macro</title>
			<pubDate>Mon, 08 Jun 2020 11:25:16 +0000</pubDate>
			<dc:creator><span class="user anonymous" rel="bubbletip_comment_1115">Joey</span> <span class="bUser-anonymous-tag">[Visitante]</span></dc:creator>
			<guid isPermaLink="false">c1115@https://blog.open-office.es/</guid>
			<description>&lt;p&gt;Hola&lt;br /&gt;
Me ha parecido muy interesante poder insertar las funciones nativas de CALC dentro del macro de OOo basic. Alctualmente estoy intentando insertar otra funcion que no sea SUM y he utilizado el Modo 2 de su explicacion anterior y al tener varias variables, en mi función,  las he separado con comas, pero luego el resultado sale siempre 0. No me sale error, y la hoja activa es la correcta. Alguien me puede ayudar. Gracias !!!&lt;/p&gt;

&lt;p&gt;Function FuncionCalc( Nombre As String, Datos() )&lt;br /&gt;
  &#039; Esta función permite llamar a una función de Calc por su nombre en Inglés	&lt;br /&gt;
	Dim oSFA As Object&lt;br /&gt;
	oSFA = createUnoService( &quot;com.sun.star.sheet.FunctionAccess&quot; )&lt;br /&gt;
	FuncionCalc = oSFA.callFunction( Nombre, Datos() )&lt;br /&gt;
End Function&lt;/p&gt;

&lt;p&gt;Sub testNativFunctions&lt;br /&gt;
Dim dSuma As Double&lt;br /&gt;
Dim oHoja As Object&lt;br /&gt;
	oHoja = ThisComponent.CurrentController.ActiveSheet	&lt;br /&gt;
	dSuma = FuncionCalc( &quot;MATCH&quot;, Array(&quot;Zona&quot;,oHoja.getCellRangeByName(&quot;A1:A12&quot;),0) )&lt;br /&gt;
Msgbox dSuma&lt;br /&gt;
End sub&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>Hola<br />
Me ha parecido muy interesante poder insertar las funciones nativas de CALC dentro del macro de OOo basic. Alctualmente estoy intentando insertar otra funcion que no sea SUM y he utilizado el Modo 2 de su explicacion anterior y al tener varias variables, en mi función,  las he separado con comas, pero luego el resultado sale siempre 0. No me sale error, y la hoja activa es la correcta. Alguien me puede ayudar. Gracias !!!</p>

<p>Function FuncionCalc( Nombre As String, Datos() )<br />
  ' Esta función permite llamar a una función de Calc por su nombre en Inglés	<br />
	Dim oSFA As Object<br />
	oSFA = createUnoService( "com.sun.star.sheet.FunctionAccess" )<br />
	FuncionCalc = oSFA.callFunction( Nombre, Datos() )<br />
End Function</p>

<p>Sub testNativFunctions<br />
Dim dSuma As Double<br />
Dim oHoja As Object<br />
	oHoja = ThisComponent.CurrentController.ActiveSheet	<br />
	dSuma = FuncionCalc( "MATCH", Array("Zona",oHoja.getCellRangeByName("A1:A12"),0) )<br />
Msgbox dSuma<br />
End sub</p>]]></content:encoded>
			<link>https://blog.open-office.es/calc/utilizar-una-funcion-de-calc-desde-una-macro#c1115</link>
		</item>
			</channel>
</rss>
