Saturday, March 1, 2008

Launching Salesforce ID links from Excel

I've built a lot of Excel pivottables that work of a local copy of our Salesforce data (thanks forceAmp!) and one feature that I incorporated into them that's very popular is the ability to click on a cell that has a Salesforce ID (15 or 18 digit versions, either will work) and then run a very simple macro either from a button on the toolbar or from a keyboard shortcut that will take the user to that record in Salesforce. It's an incredibly simple macro, too. Here it is:

ActiveWorkbook.FollowHyperlink ("https://na3.salesforce.com/" + ActiveCell.Text)

Note that na3 will need to be replaced with your Salesforce server code. If anyone needs help in creating this macro and adding it to the toolbar and as a shortcut, let me know and I'll add those instructions. If anyone comes up with improvements to this thing, that would be cool, too. It doesn't gracefully handle it when a user doesn't have an ID selected, for example.

No comments: