JonTebbens
Technical User
This bit refreshes the docuemnt on Open. Works fine by itself.
Private Sub Document_Open()
marker = 21
Application.Documents.Item(1).Refresh
marker = 22
end sub
When I add some code to execute AfterRefresh, in order to export the newly refreshed data, I hit the error handler. marker = 21 when it fails. Essentially, it never gets to the following step.
Private Sub Document_AfterRefresh()
If I follow the debug, I end up in the error handler with some undefined object...no surprise there.
If I look at the BO screen, it has not refreshed yet. It still says please wait... If I quit the debugger, the BO screen paints. If I then trigger the code that is supposed to run after refresh, it works fine. There are two data providers, in case that makes any difference. Is the AfterRefresh perhaps kicking off after the first data provider and not waiting until all have completed?
Appreciate any ideas.
Jon Tebbens
Private Sub Document_Open()
marker = 21
Application.Documents.Item(1).Refresh
marker = 22
end sub
When I add some code to execute AfterRefresh, in order to export the newly refreshed data, I hit the error handler. marker = 21 when it fails. Essentially, it never gets to the following step.
Private Sub Document_AfterRefresh()
If I follow the debug, I end up in the error handler with some undefined object...no surprise there.
If I look at the BO screen, it has not refreshed yet. It still says please wait... If I quit the debugger, the BO screen paints. If I then trigger the code that is supposed to run after refresh, it works fine. There are two data providers, in case that makes any difference. Is the AfterRefresh perhaps kicking off after the first data provider and not waiting until all have completed?
Appreciate any ideas.
Jon Tebbens