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
ahab1372ahab1372 

tweaking excel connector

Hi All,

If anyone is using the connector with API version 7.0 or higher and you encounter issues with queries including a date field, or if you want to increase the batch size to 200, try the following:

 

 Tweaking sforce excel connector
Do at your own risk.
These modifications are unsupported.


Modify query format for queries with date fields
• Only necessary if you use API 7.0 or higher and your query includes a date field (query returns an error)
• Open the Script editor from Excel (Alt + F11)
• In the Project sforce_connector, double-click “utils”
• In the upper right drop down menu, navigate to the function “sfQueryValueFormat”
• Change the line Case "datetime", "date": to Case "datetime":
• Add the following code block above the line Case "double", "currency", "percent":

 

 

Case "date":
If (InStr(LCase(vlu), "today")) Then
Dim today2 As Date: today2 = Date
Dim daychange2 As Variant, incr2%: incr2 = 0
If (InStr(LCase(vlu), "-")) Then
daychange2 = Split(vlu, "-")
incr2 = 0 - Int(daychange2(1))
End If
If (InStr(LCase(vlu), "+")) Then
daychange2 = Split(vlu, "+")
incr2 = Int(daychange2(1))
End If
vlu = DateAdd("d", incr2, today2)
End If ' 5.12 end

sfQueryValueFormat = Format$(vlu, "yyyy-mm-dd")

 

 

 

 


• Close the editor

 

Increase batch size of queries,inserts and updates
• Open the Script editor from Excel (Alt + F11)
• In the Project sforce_connector, double-click “s_force”
• Find the line Const maxBatchSize As Integer = 50 and change the value 50 to 200
• More than 200 will not work

Paul OveryPaul Overy
The latest version is asking for an SFDCExcelAddin Password.
ahab1372ahab1372

the SFDCExcelAddin is actually the official SFDC "Connect for Office" plug-in. It is passowrd protected and I never tried to modify it.

The Excel Connector (which is unsupported by SFDC, download here: http://sforce.sourceforge.net/excel/index.htm ) is not password protected. It shows as sforce_connector in the Script Editor.