• ovill
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 8
    Replies

Hi,

 

Trying to get information from SObjects in order to know the last Update date information of each one, I found some issues with VBA SFDC library:

 

  1. SForceSession4.EntityNames array cannot be used as parameter to SForceSession4.DescribeSObjects because it is a Variant array. Ok, let's take the EntityNames array and construct an array of string with it. This will avoid the "Run-time error. Automation error. Unespecified error" message
  2. After fixing the previous issue, the DescribeSObjects works but, where is the description of each SObject described? 
  3. If we use the Object Browser in VBA IDE, we can see that Salesforce Toolkit 4.0, SForceSession4.DescribeSObjects  is a SUB and NOT a FUNCTION, even more, there is no DescribeSObjectResult type in the DLL that will allow us to check the description of each described object

 

Does anyone have an idea of how to use this DescribeSObjects sub?

 

Thanks!

  • April 16, 2012
  • Like
  • 0

Hi,

 

Trying to get information from SObjects in order to know the last Update date information of each one, I found some issues with VBA SFDC library:

 

  1. SForceSession4.EntityNames array cannot be used as parameter to SForceSession4.DescribeSObjects because it is a Variant array. Ok, let's take the EntityNames array and construct an array of string with it. This will avoid the "Run-time error. Automation error. Unespecified error" message
  2. After fixing the previous issue, the DescribeSObjects works but, where is the description of each SObject described? 
  3. If we use the Object Browser in VBA IDE, we can see that Salesforce Toolkit 4.0, SForceSession4.DescribeSObjects  is a SUB and NOT a FUNCTION, even more, there is no DescribeSObjectResult type in the DLL that will allow us to check the description of each described object

 

Does anyone have an idea of how to use this DescribeSObjects sub?

 

Thanks!

  • April 16, 2012
  • Like
  • 0

I am attempting to use the DescribeSOBjects using the office toolkit vs. 4.0, and cannot seem to get this to work properly.

 

Does anyone have some good examples of how to use this method in the VBA editor?

 

Thanks.

 

Private Sub GetSObjects_Click()

    Dim Username As String
    Dim Password As String
    Username = "user@user.org"
    Password = "password"

    Dim sfSession As SForceSession4
    Set sfSession = New SForceSession4
    
    Dim dsr() As String
    If sfSession.Login(Username, Password) Then
        dsr = sfSession.DescribeSObjects( "Account")
    Else
        MsgBox "Invalid Login"
    End If

End Sub

 

When I run the above line I get an error saying Expected Function or Variable

 

Even when I change dsr = sfSession.DescribeSObjects( "Account") to

 

sfSession.DescribeSObjects( "Account"

 

I still get an error saying: Array passed to DescribeSObject needs to be of type VT_BSTR or BT_VARIANT.

 

Any help would be appreciated.

 

Thanks.