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
JimmyC1228JimmyC1228 

Refreshing Reports in Excel VBA

I am trying to write some code in VBA in Excel using the Office Edition toolbar to automatically refresh the reports in a workbook when a button is pressed.  When I first open the file and press the button, Excel tells me that the requested file cannot be found.  My code looks like this:

 If Not (SFDCExcelAddin.CommandBarRelated.IsLoggedIn) Then
        SFDCExcelAddin.CommandBarRelated.Login
    End If
   
    Sheets("Raw SalesForce Data").Select
    SFDCExcelAddin.CommandBarRelated.RefreshAll

If I change RefreshAll to Refresh and then select the desired report, it works fine; so, I don't understand why RefreshAll can't find the report.  Alternatively, if I manually refresh the report from the toolbar, and then run my subroutine it works.  Does anyone have any idea what might be causing this or how to get around it?  Also, does any one know where I can find documentation for the SFDCExcelAddin library so that I can better understand what the methods do and how to work with them?  Thanks.


catharsis50catharsis50

I have been using the formula reffered to by the person above to refresh all. Does anyone have a solution to simulate the commandbar function of refresh existing reports>"specific report reference". My issue is that "refreshing all" seems to crash excel 3/4 of the time, but found if I refresh one report at  a time it works.

 

Any help/suggestions are appreciated.