Excel 2010, Windows 7, custom VSTO add-in launched from ribbon

I am trying to automate several workbooks that require a custom VSTO add-in to refresh a connection to a data source. I contacted the developer but they said the sendkeys workaround was the only way to automate the process right now. It's easy enough if I am in the file, I simply navigate to the "Add-Ins" tab and select "Refresh." Using a few simple lines of code, it is also easy enough to navigate to the button via sendkeys with the as shown below. However, the real goal is to launch several workbooks that need updating and that's where the issue lies. I open the workbook just fine (Workbooks.Open) but the add-in does not allow the sendkeys to be passed through because the button is grayed out. The add-in's "Refresh" button is only visible when there is an active query in the selected worksheet, which there is but the add-in can't see it for some reason. When I use the mouse to select a cell, the Refresh button immediately illuminates. I have tried every combination of activations/selections/pauses/etc. that I could think of. I'm hoping that I am just missing something obvious. Any help would be much appreciated. Thanks.

Please Login or Register  to view this content.