Need help with SUBDEFINE. Could not find anything that was solved. Please help.

Post Reply
initm1
Posts: 32
Joined: Mon Jul 20, 2015 7:19 am
OLAP Product: Microsoft
Version: 10.2
Excel Version: OFFICE365

Need help with SUBDEFINE. Could not find anything that was solved. Please help.

Post by initm1 »

Hi everyone, I am trying to make SUBDEFINE function work for me.
I have tried multiple ways but couldn't make it work. Please help. below is what I have.

thanks in advance.

Code: Select all

Sub testSubset()
Dim x

ThisWorkbook.Activate
ActiveSheet.Activate
x = Application.Run("SUBDEFINE", "dev1.dev.boa.com:HeadCount", "testVBss", "A1:A10")
Debug.Print x
    
End Sub
TM1.Prespectives.Win7.Office365,Excel2016,Excel2010
Paul Segal
Community Contributor
Posts: 306
Joined: Mon May 12, 2008 8:11 am
OLAP Product: TM1
Version: TM1 11 and up
Excel Version: Too many to count

Re: Need help with SUBDEFINE. Could not find anything that was solved. Please help.

Post by Paul Segal »

Try replacing "A1:A10" with

Code: Select all

Worksheets("Worksheetname").Range("A1:A10")
The whole thing should read

Code: Select all

 x = Application.Run("SUBDEFINE", "dev1.dev.boa.com:HeadCount", "testVBss", Worksheets("Worksheetname".Range("A1:10"))
Obviously, replace Worksheetname with the name of your worksheet.
Paul
initm1
Posts: 32
Joined: Mon Jul 20, 2015 7:19 am
OLAP Product: Microsoft
Version: 10.2
Excel Version: OFFICE365

Re: Need help with SUBDEFINE. Could not find anything that was solved. Please help.

Post by initm1 »

Hi Paul, I tried the same but still wont work. x returns false. I verified it in Cube Viewer too.
Is there something I could be missing or has the admin disabled this feature? any way to find the reason?
TM1.Prespectives.Win7.Office365,Excel2016,Excel2010
User avatar
Steve Rowe
Site Admin
Posts: 2417
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Need help with SUBDEFINE. Could not find anything that was solved. Please help.

Post by Steve Rowe »

Are you connected to the server, either with N_Connect or through the front end?
Can you get simple functions like DIMIX to work?

The VBA TM1 client also tends to have an issue with the reconnection of broken connections so for example if your connection expires and then you re log, the front end will work but the VBA doesn't.
Technical Director
www.infocat.co.uk
initm1
Posts: 32
Joined: Mon Jul 20, 2015 7:19 am
OLAP Product: Microsoft
Version: 10.2
Excel Version: OFFICE365

Re: Need help with SUBDEFINE. Could not find anything that was solved. Please help.

Post by initm1 »

Okay thank you. Let me play around with connection and see if I can make it work. Will post back tomorrow. Good day!
TM1.Prespectives.Win7.Office365,Excel2016,Excel2010
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: Need help with SUBDEFINE. Could not find anything that was solved. Please help.

Post by paulsimon »

Also try using a named range - simpler than A1:A10
Post Reply