function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alex CaineAlex Caine 

How do I add a reference to SFDCExcelAddin in Excel VBA?

Hopefully someone can help me as I've been stuck on this for hours. I need to write macros for a number of functions in Excel VBA to access and manipulate SF data. I've had success using the sforce Connector addin via GUI but I now need to move to VBA. HOWEVER, everywhere I look online I see the step "add a reference to SFDCExcelAddin" and I can't figure out how to do this. I don't have SFDCExcelAddin in the Object Explorer. I do have "s_force" in the object explorer but it does not contain the same methods. Where is this located?? Thanks to anyone who is able to help!
Anoop Kumar 18Anoop Kumar 18
Use Below Code after adding reference for Sales Force in library

'Written by Anoop Kumar
Public g_sfApi As SForceOfficeToolkitLib4.SForceSession4
Public Sub Proc_FetchingReports(UserName, Password)
    'On Error GoTo HandleError
    Dim url As String
    blnLoggedIn = False
    'Set g_sfApi = New SForceOfficeToolkitLib4.SForceSession4
    g_sfApi.Login UserName, Password
    
    'In case login failed
    If g_sfApi.IsLoggedIn = False Then
        'Proc_LoginError
        blnLoggedIn = False: Exit Sub
    Else
        blnLoggedIn = True
    End If
    g_sfApi.SetCookie "https://na6.salesforce.com", "sid", g_sfApi.SessionId
    'Proc_ReportSRM_Path
    
    
'HandleError:
    'MsgBox Err.Description
 '   Proc_LoginError
End Sub
Public Sub Proc_Login()
    Call Proc_FetchingReports(YOUR USER NAME, YOUR PASSWORD + SALESFORCE TOKEN)
    'Proceeding with Data..........
End Sub

 
shreya Sharma 42shreya Sharma 42
If you are search an online game then try text twist free (https://texttwist.online) online game you can play this game without any signup.