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
rdearnrdearn 

Automatically running Table query Wizard from a macro

Dear all,

Would someone be able to tell me if it is possible to programatically drag down data from Salesforce to Excel at set times throughout the day?

My idea was to run some VBA code at set intervals which would then bring back the reports that I wanted.

I have both the Salesforce Connector and the Office Edition

Any help would be greatley appreciated

thanks

Richard
rdearnrdearn
Thanks for looking but have it sorted now.
flescorflescor

How about letting us in on how you did it?  Sounds like a useful general thing to know.

 

Scott

rdearnrdearn
Of course,

Sorry thought was too simple though!

All that I do is I have a simple VBA macro that runs at 15:00 every day in Excel.

All I do is populate the first row with the fields that I want and then the second row with the columns I want to appear. I then call the Excel connector which does all the hardwork!

My code.


Sub OpenIssues()

Dim StartTime, FinishTime, TotalTime

StartTime = Timer

With ActiveWorkbook.Worksheets("Sheet1"

'to alter the statment for extracting data

.Range("A1".Value = "Case"
.Range("B1".Value = "Status"
.Range("C1".Value = "Not Equals"
.Range("D1".Value = "Closed"

.Range("A2".Value = "Case ID"
.Range("B2".Value = "Description"
.Range("C2".Value = "Priority"
.Range("D2".Value = "Status"
.Range("E2".Value = "Subject"
.Range("F2".Value = "Client (For Internal issues)"
.Range("G2".Value = "Department Resp"
.Range("H2".Value = "JHC Job Number"
.Range("I2".Value = "Key Word"
.Range("J2".Value = "Person Responsible"

End With

Sheets("Sheet1".Select
Range("A1".Select

sfQuery

FinishTime = Timer

TotalTime = Int(FinishTime - StartTime)

MsgBox "Ran for " & TotalTime & " seconds"

End Sub
Riley BRiley B

Thank You.

 new way of looking at a problems solution.

i like this

MDB80MDB80

HI, I can't seem to get the sfQuery function to work.. it's saying not defined? I want to create a simple button / macro to run the Query Table Data function!? Any ideas why this isn't recognising it?