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 » Fri Oct 16, 2009 4:58 pm

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: 2322
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: Office 365 - latest
Location: Brussels, Belgium
Contact:

Re: TM1 Action Button's and VBA

Post by Wim Gielis » Fri Oct 16, 2009 8:06 pm

Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 109 TM1 articles and a lot of custom code
Newest blog article: Set up a TM1 model with AutoHotKey as a service or application

User avatar
garry cook
MVP
Posts: 197
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 » Mon Oct 19, 2009 12:05 pm

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 571 times

User avatar
paulsimon
MVP
Posts: 729
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 » Tue Oct 20, 2009 11:05 pm

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 » Mon Jul 26, 2010 1:31 pm

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: 117
Joined: Thu Aug 28, 2008 4:42 am
Location: Sydney, Australia

Re: TM1 Action Button's and VBA

Post by yyi » Fri Jan 23, 2015 12:30 am

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
win2012 svr: tm1 v10.2.2 x64, client v10.2.2 x64/PA 2.0, win10, excel 365.

Post Reply