Page 1 of 1

Application.Run "TM1Update"

Posted: Tue Mar 05, 2013 12:00 am
by yyi
Hi Everyone,

Is there anyone who remembers or knows what this macro does?
I can't find anything in the current documentation ..


Thanks

Re: Application.Run "TM1Update"

Posted: Tue Mar 05, 2013 2:13 am
by Alan Kirk
yyi wrote:Hi Everyone,
Is there anyone who remembers or knows what this macro does?
I can't find anything in the current documentation ..
It rings a very vague bell, but I can't place it. All I know for sure is that it's old... very old. The only reference I can find to it in any documentation is in the version 8.2.1 Release Notes which read:
272059 Macros including TM1UPDATE are now backwards compatible with earlier versions of TM1. If you recorded an Excel macro with an earlier version of TM1, you can run this macro without error against TM1 8.2.1
I tried doing a few things and recording them using the macro recorder but nothing that I did yielded that. Conversely I couldn't get the macro to do anything in Excel either.

Might help if you provided the context in which it appears in your code (which I would assume you inherited from past users).

Re: Application.Run "TM1Update"

Posted: Tue Mar 05, 2013 3:41 am
by yyi
Alan Kirk wrote:Might help if you provided the context in which it appears in your code (which I would assume you inherited from past users).
Yes, it's from an old workbook. Not sure if this helps but I've pulled out a section of code around where it's used.

Code: Select all

    Range("A2").Select
    ActiveCell.FormulaR1C1 = _
        "=IF(RC[5]=""CMBF"",""CORPORATE OVERSEAS"",IF(OR(RC[2]=""FFX"",RC[1]=""INT'L EQUITY"",RC[1]=""""),""CASH"",IF(RC[1]=""FUTURES"",""CASH"",IF(RC[5]=""AMPIIDW"",""CASH"",IF(RC[5]=""BZWBGWEA"",""INTERNATIONAL EQUITY (UNHEDGED)"",IF(RC[5]=""UBGIHWEI"",""INTERNATIONAL EQUITY (HEDGED)"",RC[1]))))))"
    Application.Run "TM1UPDATE"
    Selection.Copy
    Range("A2", Cells(rowcount + 1, 1)).Select
    ActiveSheet.Paste

Re: Application.Run "TM1Update"

Posted: Tue Mar 05, 2013 4:20 am
by Alan Kirk
yyi wrote: Yes, it's from an old workbook. Not sure if this helps but I've pulled out a section of code around where it's used.

Code: Select all

    Range("A2").Select
    ActiveCell.FormulaR1C1 = _
        "=IF(RC[5]=""CMBF"",""CORPORATE OVERSEAS"",IF(OR(RC[2]=""FFX"",RC[1]=""INT'L EQUITY"",RC[1]=""""),""CASH"",IF(RC[1]=""FUTURES"",""CASH"",IF(RC[5]=""AMPIIDW"",""CASH"",IF(RC[5]=""BZWBGWEA"",""INTERNATIONAL EQUITY (UNHEDGED)"",IF(RC[5]=""UBGIHWEI"",""INTERNATIONAL EQUITY (HEDGED)"",RC[1]))))))"
    Application.Run "TM1UPDATE"
    Selection.Copy
    Range("A2", Cells(rowcount + 1, 1)).Select
    ActiveSheet.Paste
Based on that it almost looks like it was expected to recalculate TM1 formulas when a cell reference changed; essentially it's the kind of place where I'd expect to find Application.Run "TM1RECALC". However it doesn't work; or not in 9.0 it doesn't. Whether it was "undocumentedly depreciated" between 8.2.x and 9.0 is another matter. (Although having said that, I just found a surviving instance of 8.2.12, and it didn't seem to do anything there either.)

Re: Application.Run "TM1Update"

Posted: Thu Mar 07, 2013 5:54 am
by yyi
Thanks Alan,

Maybe it's one of those codes in tm1p.xla that had it's function commented out but not deleted..

I've found out the workbook is about 10yrs old and sections of the macro had become either outdated or no longer used.

Re: Application.Run "TM1Update"

Posted: Thu Mar 14, 2013 3:24 pm
by risk

Code: Select all

'' called by the old OnEntry event model, replaced by SheetChange but left in for compatibility
'' with pre-existing recorded macros
Public Sub TM1UPDATE()
''   Application.EnableEvents = False
''   Application.Run ("TWEVUPDATE")
''   Application.EnableEvents = True
End Sub
Anyone care to follow the rabbit hole to find what TWEVUPDATE does?