• elipman
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies
I'm using the salesforce outlook toolkit, and am already logged into the salesforce via my own VBA code.. I'd like to jump from my code to use the excel connector and query all the table data on a certain excel sheet.. I'm doing this via the sfqueryall function....

even though I'm already logged in, it prompts me to login a 2nd time... is there anyway to tell the connector I'm logged in, so that it doesn't prompt me for this redundant 2nd login?


I've cannibalized some code written by somebody else at my company that logs into salesforce from an existing vb project and allows us to search and select a specific account for which to download data.  The login routine uses the office toolkit.  My goal of this post is to eliminate a redundant 2nd login prompt that currently pops up as a result of me being a hack / novice of a programmer. After using the existing code, to login, perform a keyword search, and select the appropriate account, I then store that opportunity ID in a cell in excel, and use that as the input to the salesforce connector with which I grab the rest of the info I want for associated contacts, account, and opportunity details.
Sub UpdateWithSforceConnector()

On Error GoTo Err_UpdateWithSforceConnector
    Sheets("FROM SALESFORCE").Activate
    Call sfqueryall(True)
   
Exit_UpdateWithSforceConnector:
    Exit Sub

Basically I jump over to the excel connector with an SFQueryall, but that often triggers a 2nd login dialog box from the excel connector before downloading the data.



Obviously, I just logged in via the office toolkit in my own VBA project, so I shouldn't need a 2nd login.

I'd like to either bypass this 2nd login by jumping into the excel connector's query all function AFTER this login prompt, or pass my credentials from the first login in my excel VBA project, over to the excel connector, and it can just login a 2nd time without me actually typing the password again.

or perhaps there is a way to pass the status "already logged in" from my VBA project over to the excel connector around the same time as I do the sfqueryall?

I'm a total hack when it comes to programming, so I really appreciate the hand holding!

Thanks in Advance,
Ethan


Message Edited by elipman on 07-15-2008 11:52 AM
I took a couple screen captures to help illustrate what I'd like to do
http://picasaweb.google.com/ethan.lipman/SalesforceHelp
From Salesforce Help
From Salesforce Help
basically right now, the user of this tool I made has to enter there credentials twice.  Once at my custom login / search form, and then again when control is passed to the sforce_connector.xla.

Can anybody offer some VBA / sforce_connector help?  I'm a VBA novice, and was wondering how I can pass the collected username and pword over to the sforce_connector.xla login routine..  and execute it. seems like there should be a place that the username a pword could be stored, and when I invoke the xl connector.xla login, to prime it and auto_login with the user an pword that my own project already collected. thanks in advance everyone!

-Ethan in San Diego


Message Edited by elipman on 03-08-2008 01:24 PM
I've got a field called "Role ID" for my company's Salesforce Users, where the Value ranges from
Project Manager New England
Project Manager Northern California
Project Manager Southern California



I wanted to set my query with the excel connector to pull into excel all users that are project managers in all locations

so I set my query as you can see:



ran the query, and got the following error




anybody encountered this before?  How do I use these "includes" and "like" opperators successfully?  Do I need to put a "*" or  %" in my key term somewhere as a wild card?  Looks my syntax is botched.. but it is made by the wizard....


Thanks in advance for any help the community can offer.

Cheers,
Ethan in San Diego
I'm tinkering with VBA for the first time, and I'm trying to set up a spreadsheet on which I can click a button on the first sheet (tab) of my excel document that calls the "run each query on current sheet" function built into the sforce connector's toolbar.

A co-worker that knows way more about this than me suggested this line of code for running all queries on all sheets.

Sub ButtonName_Click()
Application.run "'sforce_connect.xla'!sfQueryAllSheets()"
End Sub
Turns out I don't want to run all queries on ALL sheets because that triggered some funky things happening on other sheets of my document that I didn't intend to modify.

SO...   I tried this code sample below that a community member named "PAL" had posted here:
http://community.salesforce.com/sforce/board/message?board.id=Excel_Connector&message.id=242#M242
Private Sub CmdButUpdSforce_Click()
On Error GoTo Err_CmdButUpdSforce_Click
    Sheets("opps").Activate
    Call sfqueryall(True)
   
Exit_CmdButUpdSforce_Click:
    Exit Sub

Err_CmdButUpdSforce_Click:
    MsgBox Err.Description
    Resume Exit_CmdButUpdSforce_Click
End Sub
I changed "opps" to the name of my 2nd sheet "FROM SALESFORCE" that contains the queries I want to update.

This chunk of code failed with a compile error "sub or function not defined"
Specifically, it fails when it calls sfqueryall(true)

Playing around, I found that if I added this same code as a module within sforce_connect.xla, it worked perfectly, but when I add it as a module in my excel document, sfqueryall(true) fails.

From my limited programming knowledge, that tells me that even though sforce.connect.xla is an active "add-in,"  I still need to "include" the code somehow before I call one of the connector's internal functions.

Do I have the connector installed incorrectly?  am I calling its internal functions incorrectly?  or is there some simple include statement I need to issue before calling an internal function?

Alternatively to "running all queries on current sheet", it would seem quite elegant to just update the table data for the 5 different rows that I need to update sequentially.

With what I currently have working, I have to query each row manually.
select row22 - and choose "query table data" from the sforce connector toolbar.
select row25  - again query table data from the toolbar
and again for 3 or 4 more tables since I'm downloading the opportunity, contact, account, opportunitylintims,  pricebook entry, and pricebook2

You can probably see why I want to automate this with a button on the first tab. I'm sure if I had some experience with VBA, this would be a no brainer. I'll learn quickly if I can get a little assistance here.

Thanks in advance!
-Ethan

Message Edited by elipman on 09-22-2007 05:47 PM

  • September 23, 2007
  • Like
  • 0
I've got a field called "Role ID" for my company's Salesforce Users, where the Value ranges from
Project Manager New England
Project Manager Northern California
Project Manager Southern California



I wanted to set my query with the excel connector to pull into excel all users that are project managers in all locations

so I set my query as you can see:



ran the query, and got the following error




anybody encountered this before?  How do I use these "includes" and "like" opperators successfully?  Do I need to put a "*" or  %" in my key term somewhere as a wild card?  Looks my syntax is botched.. but it is made by the wizard....


Thanks in advance for any help the community can offer.

Cheers,
Ethan in San Diego
I'm tinkering with VBA for the first time, and I'm trying to set up a spreadsheet on which I can click a button on the first sheet (tab) of my excel document that calls the "run each query on current sheet" function built into the sforce connector's toolbar.

A co-worker that knows way more about this than me suggested this line of code for running all queries on all sheets.

Sub ButtonName_Click()
Application.run "'sforce_connect.xla'!sfQueryAllSheets()"
End Sub
Turns out I don't want to run all queries on ALL sheets because that triggered some funky things happening on other sheets of my document that I didn't intend to modify.

SO...   I tried this code sample below that a community member named "PAL" had posted here:
http://community.salesforce.com/sforce/board/message?board.id=Excel_Connector&message.id=242#M242
Private Sub CmdButUpdSforce_Click()
On Error GoTo Err_CmdButUpdSforce_Click
    Sheets("opps").Activate
    Call sfqueryall(True)
   
Exit_CmdButUpdSforce_Click:
    Exit Sub

Err_CmdButUpdSforce_Click:
    MsgBox Err.Description
    Resume Exit_CmdButUpdSforce_Click
End Sub
I changed "opps" to the name of my 2nd sheet "FROM SALESFORCE" that contains the queries I want to update.

This chunk of code failed with a compile error "sub or function not defined"
Specifically, it fails when it calls sfqueryall(true)

Playing around, I found that if I added this same code as a module within sforce_connect.xla, it worked perfectly, but when I add it as a module in my excel document, sfqueryall(true) fails.

From my limited programming knowledge, that tells me that even though sforce.connect.xla is an active "add-in,"  I still need to "include" the code somehow before I call one of the connector's internal functions.

Do I have the connector installed incorrectly?  am I calling its internal functions incorrectly?  or is there some simple include statement I need to issue before calling an internal function?

Alternatively to "running all queries on current sheet", it would seem quite elegant to just update the table data for the 5 different rows that I need to update sequentially.

With what I currently have working, I have to query each row manually.
select row22 - and choose "query table data" from the sforce connector toolbar.
select row25  - again query table data from the toolbar
and again for 3 or 4 more tables since I'm downloading the opportunity, contact, account, opportunitylintims,  pricebook entry, and pricebook2

You can probably see why I want to automate this with a button on the first tab. I'm sure if I had some experience with VBA, this would be a no brainer. I'll learn quickly if I can get a little assistance here.

Thanks in advance!
-Ethan

Message Edited by elipman on 09-22-2007 05:47 PM

  • September 23, 2007
  • Like
  • 0