The most important thing when you are working with VBA in Analysis for Office, is the refresh of the DataSource(s). Otherwise nothing works. Once a connection to the Business Warehouse is established, each DataSource needs to be refreshed.
If you have only one DataSource, that is the source code:
If you have more than one DataSource, this is the source code:
So that you know if the refresh was successful, you should use the following source code:
Therefore you can check lResult to 1 or 0. If you refresh the DataSource(s) each time, a lot of time is wasted. To counteract this, there is the following source code:
This command checks if the DataSource is already active. Here an example source code:
After this you can excute your own code.
So far is nothing in the help file, but it is called in the SCN Forum under "Whats new in Analysis for Office 2.1".
The command is: