TM1 Action Button's and VBA

Post Reply
Kaveenga
Posts: 59
Joined: Mon Jun 02, 2008 8:49 pm
OLAP Product: TM1 Palo
Version: TM1 9.x Palo 3.2
Excel Version: 2003 2007 2010

TM1 Action Button's and VBA

Post by Kaveenga »

Hi All

In Excel VBA, the TIButton object lists has having the following members. The DoRunTI member seems particularly useful. Has anyone directly access the TIButton object via VBA? If so would appreciate if you can share a snippet of code!

Many thanks

Kaveenga

--------------------------------------------------------------

AutoRecalc
AutoTitles
BackColor
Caption
ConfirmMessage
DisplayHyperlink
DoNavigate
DoRunTI
FailureMessage
Font
ForeColor
ImageName
IsMappingFormula
ParameterName
ParameterType
ParameterValue
ProcessImage
ProcessName
ProcessNameFormula
ProcessParamFormula
ReplaceWindow
ServerName
ShowConfirmMessage
ShowFailureMessage
ShowSuccessMessage
SourceObjects
SourceObjectsFormula
SourceTypes
SourceTypesFormula
SuccessMessage
TargetAliases
TargetAliasesFormula
TargetObjects
TargetObjectsFormula
TargetSubsets
TargetSubsetsFormula
TargetTypes
TargetTypesFormula
TargetValues
TargetValuesFormula
TargetWorkbookName
TargetWorksheetName
UseApporg
UseFormula
UseImage
Version

AboutBox
GetProcess
SavePictureToFile
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TM1 Action Button's and VBA

Post by Wim Gielis »

Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
garry cook
Community Contributor
Posts: 209
Joined: Thu May 22, 2008 7:45 am
OLAP Product: TM1
Version: Various
Excel Version: Various

Re: TM1 Action Button's and VBA

Post by garry cook »

Not really played with Action Buttons but I guess what you're trying to do is run a process from VBA. Attached is a file that does this.

HTH
Attachments
Run a process from Excel.xls
(181.5 KiB) Downloaded 907 times
User avatar
paulsimon
MVP
Posts: 808
Joined: Sat Sep 03, 2011 11:10 pm
OLAP Product: TM1
Version: PA 2.0.5
Excel Version: 2016
Contact:

Re: TM1 Action Button's and VBA

Post by paulsimon »

Hi

I don't think that there is any bug here. Cognos in their infinite wisdom have just decided not to expode the method that will allow you to run the TIButton programmatically.

The DoRunTI is a property rather than a method. It just returns true or false according to whether the TI Button is set up to run a TI or do a Worksheet jump.

There is no method to execute the TI.

Therefore I think the only way is to use the API calls. Wasn't the introduction of the Action Button supposed to get around that?

Regards


Paul Simon
AmbPin
Regular Participant
Posts: 173
Joined: Sat Mar 20, 2010 3:03 pm
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2007-10

Re: TM1 Action Button's and VBA

Post by AmbPin »

Hello,

Not sure if this is what you were looking for but it may help:-

Dim sht As Worksheet
Dim tib As TM1XlCubeView_1_4.TIButton
Dim obj As Object

Set sht = ActiveWorkbook.Sheets(1)

For Each obj In sht.OLEObjects
If obj.progID = "TM1XL.TIButtonCtrl.1" Then
Set tib = sht.OLEObjects("TIButton1").Object
End If
Next
User avatar
yyi
Community Contributor
Posts: 122
Joined: Thu Aug 28, 2008 4:42 am
Location: Sydney, Australia

Re: TM1 Action Button's and VBA

Post by yyi »

Very useful code, thanks! :D

Was needing to change properties in a list of action buttons displayed as hyperlinks.

btw. an alternative to using progID's is Shape.Name
eg:
...
Dim vShape as Shape

For Each vShape In sht.Shapes
If Left(vShape.Name, 8) = "TIButton" Then
Set tib = sht.OLEObjects(vShape.Name).Object
tib.Caption = "blah"
End If
Next
Yeon
Post Reply