OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Calc Cells with a calculated value

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
adrian
Guest





PostPosted: Fri Sep 05, 2003 12:32 am    Post subject: Calc Cells with a calculated value Reply with quote

I want to put the focus over a cell. Then I wan a form to be displayed with three TextBox and a Button that when is pressed returns a calculated value [f(a,b,c)] to de original cell. The cell is anyone from a cell range. íPlease Help! Confused
Back to top
adrian
Guest





PostPosted: Fri Oct 03, 2003 9:24 am    Post subject: Please help! Reply with quote

I try this but dialog doesn't appear:
REM ***** BASIC *****
Dim oPromediator as Object
Sub Main

End Sub
Sub PromediatorShow
oPromediator = LoadDialog("Standard", "Promediator")
oPromediator.Execute()
End Sub

Function HasValue(theObject as Object) As Boolean
If HasUnoInterfaces(theObject, "com.sun.star.lang.XTypeProvider") Then
HasValue = CreateUnoService("com.sun.star.beans.Introspection").inspect(theObject).hasProperty("Value", Cool 'METHODS
End If
End Function

Function GetCurrentCell as SheetCell
Dim sel
sel = ThisComponent.getCurrentController().getSelection()
If HasValue(sel) Then GetCurrentCell = sel
End Function

Function Promedia as decimal
Dim sel
GetCurrentCell.value= TextBox1.Text
End Function


I'n newbie. Please help!
Back to top
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Sat Oct 04, 2003 7:13 am    Post subject: Reply with quote

Quote:

Sub PromediatorShow
oPromediator = LoadDialog("Standard", "Promediator")
oPromediator.Execute()
End Sub


Try :
Code:

Sub PromediatorShow
DialogLibraries.LoadLibrary("Standard")
oPromediator = CreateUnoDialog( DialogLibraries.standard.Pomediator)
oPromediator.Execute()
oPromediator.Dispose()
End Sub

_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
adrian
Guest





PostPosted: Tue Oct 14, 2003 4:00 am    Post subject: Doesn't works Reply with quote

Thanks for your answer, but doesn't works
Back to top
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Tue Oct 14, 2003 9:25 am    Post subject: Reply with quote

OK; Is your dialog windows with the name promediator already created ?

There is no program in the main ? Then if you launch it in the OOoBasic editor it will be nothing executed (because it try to execute the main).

The function GetcurrentCell necessite to have e spreadsheet already open and active.

The function Promedia can't work because there is no instruction as
Code:
 Promedia = .....


I am not expert in OOoDialog. There is a good documentation in
http://api.openoffice.org/TipsAndTricks/external.html :
StarOffice 6.0 Software Basic ... Guide
and also the Andrew Pitoniac's macros, an interactive OOo document.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group