I am trying to write a VBA application in Excel that use the Dynamics SL Object Model. The application starts up the SL Tool bar and then starts up the Budget Maintenance screen. I want to read the period 13 field to see if it is enabled so I can then update the budget with either 12 or 13 columns. The problem is that I can't access the control properties other than the value itself.
My code is like this:
Dim BudgetMaint As SIVApplication
Dim MyToolbar As New SIVToolbar
Set MyToolbar = New SIVToolbar
MyServerName = Worksheets("Login").Range("B1").Value
MySysDBName = Worksheets("Login").Range("B2").Value
MyCoID = Worksheets("Login").Range("B3").Value
MyUserID = Worksheets("Login").Range("B4").Value
MyPwd = Worksheets("Login").Range("B5").Value
MyToolbar.Login MyServerName, MySysDBName, MyCoID, MyUserID, MyPwd
Set BudgetMaint = MyToolbar.StartApplication("0125000.exe")
If Worksheets("Login").Range("B6").Value = True Then
BudgetMaint.Visible = True
End If
That all works great. It starts the tool bar, opens the screen and I can populate fields. However when I run this line of code I get a 450 error
If BudgetMaint.Controls("cbdgtper(12)").Properties("Enabled") = True Then...
Plus Properties does not seem to be collection of the control.
Thinking the problem might be getting access to the enabled property I tried it with the BackColor Property of a label as described on page 37 of the version Object Model manual. That also failed.
I'm thinking that I'm missing a reference in my VBA project. The references I have are:
Visual Basic for Applications
Microsoft Excel 12.0 Object Library
Microsoft.Dynamics.SL.Object.Library
OLE Automation
Microsoft Office 12.0 Object Library
Microsoft Forms 2.0 Object Library
Anybody have any idea what I'm doing wrong?