Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ThisWorkbook.RefreshAll Issue/Question

I have a problem I was hoping someone might be able to help with. My
environment is as follows:

* OS: Windows 7 -or- Windows XP SP3 (does not seem to matter)
* Excel 2007 (12.0.6514.500) SP2 MSO (12.0.6425.1000)
* Microsoft Visual Basic 6.5.1040 (installed from the Office CD with Excel
2007)
* WSS 3.0 SP1 (on a remote server)

I am using an macro-enabled Excel workbook (xlsm) that contains connections
to a dozen SharePoint lists. When I call the ThisWorkBook.RefreshAll
function in one of my routines, I sometimes (not always) recieve multiple
error messages as follows:

* The title of the error message is "Microsoft Visual Basic".
* The prompt for the message is empty.
* It is a critical error (the "X" in the red circle is shown on the left of
the MsgBox).
* An OK and Help button are present.
* If I push the Help button, I get the default help file. So, I presume the
help context is unspecified?
* If I push the OK button, the program continues. It does not trip the error
handler in VBA surrounding the RefreshAll call.

I traced the program execution and, it happens inside the RefreshAll call.
So, I really have no way to debug this problem. I have tried the following:

* Gone to every connection and made sure that 'Enable background refresh' is
disabled. (They all were but, had to check.)
* Tried sticking a DoEvents before the call to RefreshAll. (No effect.)
* Tried setting Application.DisplayAlerts = False before the command. (No
effect.)

In desperation, I tried writing my own RefreshAll as follows:

Public Sub MyRefreshAll()
' Declare local variables.
Dim wbc As WorkbookConnection
Dim pc As PivotCache
' Refresh each connection individually.
For Each wbc In ThisWorkbook.Connections
wbc.Refresh
Next wbc
' Refresh each pivot cache indiviually.
For Each pc In ThisWorkbook.PivotCaches
pc.Refresh
Next pc
End Sub ' MyRefreshAll

This seemed to fix the issue so far. So my questions a

1. Has anyone seen this behaviour or even a resolution for it?
2. Is calling the MyRefreshAll routine above equivalent to
ThisWorkBook.RefreshAll.
3. Any suggestions on how I might track down the issue in RefreshAll?

Any assisitance would be greqatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Nothing

Nothing



Robert Cottigham wrote:

ThisWorkbook.RefreshAll Issue/Question
23-Nov-09

I have a problem I was hoping someone might be able to help with. My
environment is as follows:

* OS: Windows 7 -or- Windows XP SP3 (does not seem to matter)
* Excel 2007 (12.0.6514.500) SP2 MSO (12.0.6425.1000)
* Microsoft Visual Basic 6.5.1040 (installed from the Office CD with Excel
2007)
* WSS 3.0 SP1 (on a remote server)

I am using an macro-enabled Excel workbook (xlsm) that contains connections
to a dozen SharePoint lists. When I call the ThisWorkBook.RefreshAll
function in one of my routines, I sometimes (not always) recieve multiple
error messages as follows:

* The title of the error message is "Microsoft Visual Basic".
* The prompt for the message is empty.
* It is a critical error (the "X" in the red circle is shown on the left of
the MsgBox).
* An OK and Help button are present.
* If I push the Help button, I get the default help file. So, I presume the
help context is unspecified?
* If I push the OK button, the program continues. It does not trip the error
handler in VBA surrounding the RefreshAll call.

I traced the program execution and, it happens inside the RefreshAll call.
So, I really have no way to debug this problem. I have tried the following:

* Gone to every connection and made sure that 'Enable background refresh' is
disabled. (They all were but, had to check.)
* Tried sticking a DoEvents before the call to RefreshAll. (No effect.)
* Tried setting Application.DisplayAlerts = False before the command. (No
effect.)

In desperation, I tried writing my own RefreshAll as follows:

Public Sub MyRefreshAll()
' Declare local variables.
Dim wbc As WorkbookConnection
Dim pc As PivotCache
' Refresh each connection individually.
For Each wbc In ThisWorkbook.Connections
wbc.Refresh
Next wbc
' Refresh each pivot cache indiviually.
For Each pc In ThisWorkbook.PivotCaches
pc.Refresh
Next pc
End Sub ' MyRefreshAll

This seemed to fix the issue so far. So my questions a

1. Has anyone seen this behaviour or even a resolution for it?
2. Is calling the MyRefreshAll routine above equivalent to
ThisWorkBook.RefreshAll.
3. Any suggestions on how I might track down the issue in RefreshAll?

Any assisitance would be greqatly appreciated.

Previous Posts In This Thread:

On Monday, November 23, 2009 3:05 PM
Robert Cottigham wrote:

ThisWorkbook.RefreshAll Issue/Question
I have a problem I was hoping someone might be able to help with. My
environment is as follows:

* OS: Windows 7 -or- Windows XP SP3 (does not seem to matter)
* Excel 2007 (12.0.6514.500) SP2 MSO (12.0.6425.1000)
* Microsoft Visual Basic 6.5.1040 (installed from the Office CD with Excel
2007)
* WSS 3.0 SP1 (on a remote server)

I am using an macro-enabled Excel workbook (xlsm) that contains connections
to a dozen SharePoint lists. When I call the ThisWorkBook.RefreshAll
function in one of my routines, I sometimes (not always) recieve multiple
error messages as follows:

* The title of the error message is "Microsoft Visual Basic".
* The prompt for the message is empty.
* It is a critical error (the "X" in the red circle is shown on the left of
the MsgBox).
* An OK and Help button are present.
* If I push the Help button, I get the default help file. So, I presume the
help context is unspecified?
* If I push the OK button, the program continues. It does not trip the error
handler in VBA surrounding the RefreshAll call.

I traced the program execution and, it happens inside the RefreshAll call.
So, I really have no way to debug this problem. I have tried the following:

* Gone to every connection and made sure that 'Enable background refresh' is
disabled. (They all were but, had to check.)
* Tried sticking a DoEvents before the call to RefreshAll. (No effect.)
* Tried setting Application.DisplayAlerts = False before the command. (No
effect.)

In desperation, I tried writing my own RefreshAll as follows:

Public Sub MyRefreshAll()
' Declare local variables.
Dim wbc As WorkbookConnection
Dim pc As PivotCache
' Refresh each connection individually.
For Each wbc In ThisWorkbook.Connections
wbc.Refresh
Next wbc
' Refresh each pivot cache indiviually.
For Each pc In ThisWorkbook.PivotCaches
pc.Refresh
Next pc
End Sub ' MyRefreshAll

This seemed to fix the issue so far. So my questions a

1. Has anyone seen this behaviour or even a resolution for it?
2. Is calling the MyRefreshAll routine above equivalent to
ThisWorkBook.RefreshAll.
3. Any suggestions on how I might track down the issue in RefreshAll?

Any assisitance would be greqatly appreciated.


Submitted via EggHeadCafe - Software Developer Portal of Choice
SharePoint Video Library Template Available For Download
http://www.eggheadcafe.com/tutorials...o-library.aspx
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ThisWorkbook.Print question Dave Excel Discussion (Misc queries) 1 November 19th 07 05:55 PM
Problem with ThisWorkbook.RefreshAll Vick Excel Discussion (Misc queries) 3 September 7th 07 12:26 AM
ThisWorkbook.Activate Question [email protected] Excel Programming 5 July 5th 07 06:52 PM
'ThisWorkbook' Macro Question Dan R. Excel Programming 9 January 19th 07 06:16 PM
ThisWorkbook module question Stuart[_5_] Excel Programming 3 July 17th 04 02:32 PM


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"