Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

object model

(0) ShareShare
ReportReport
Posted on by

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?     

*This post is locked for comments

  • Re: object model

    Thanks for that information but that is not the problem I'm having.  Not being sure if it was an array problem  I tried it with name shown on the property window ie cbdgtper_array_12 as well as testing on a non-array object Ledgerid (cledgerid).  The only property I could access is the value.

    So I have some other problem.

  • pbrattin Profile Picture
    pbrattin 1,850 on at
    Re: object model

    The controls in that screen cannot be referenced as an array. Instead the SOM program has to use the name shown in the properties window for the control. To find that name, open the screen, open customization, click on the desired field, and press F4. The name is shown in the properties dialog.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans