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

Launch Connector from Macro in excel

I have tried to create a simple macro by using "Record New Macro" to Launch the Connector. It doesn't work. Does anyone know a simple way to create a macro that will launch the connector and even run a query? I am not a VB Programmer, so I would prefer to keep it simple.
I'm also interested in knowing this.  I tried recording it, but it comes up empty.  This would be extremely useful if it could be scripted.
Same here, I need to do this. Anybody help please? Thanks.

This is how I do it using vba:

"opps"  is the name of my sheet with sforce import records. I create it manually the first time using the sforce connector drop down menus.

I have a second sheet called "dashboard" with three buttons:

Update data from sforce (which gets the data from sforce)

Create reports (which generates up to 10 different reports from the raw data, using advanced filter)

Save Reports (which creates a new workbook with just the reports)

The result: The Sales exec generates his own set of control reports for easy distribution within the company.

The code for the first button is shown below:

Note: sfqueryall is a subroutine inside sforce connector that corresonds to "run each query on the current sheet"  menu item on the sforce connector toolbar.

Private Sub CmdButUpdSforce_Click()
On Error GoTo Err_CmdButUpdSforce_Click
    Call sfqueryall(True)
    Exit Sub

    MsgBox Err.Description
    Resume Exit_CmdButUpdSforce_Click
End Sub

I tried your VB code, but it said it could not find SFQUERYALL.  Could it be the code has changed because I noticed you posted this back in 2006.  Also, how did you get to the code.  When I try it asks for a password.