Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Unprotect,refresh then protect again

you have to set the Backgroundquery property of the query to False so the
code will wait for the refresh to complete.

--
Regards,
Tom Ogilvy

"Deeds" wrote in message
...
I am having a big problem trying to 1st. unprotect a sheet, in the same

code run "refresh all", then protect the sheet again. I keep getting an
error like it is trying to "refresh" after the sheet is protected
again...Can anyone explain how I unprotect, refresh then protect again?
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Unprotect,refresh then protect again

from help on Refresh for a querytable:

expression.Refresh(BackgroundQuery)

expression Required. An expression that returns a PivotCache or QueryTable
object.

BackgroundQuery Optional Variant. Used only with query tables. True to
return control to the procedure as soon as a database connection is made and
the the query is submitted (the query is updated in the background). False
to return control to the procedure only after all data has been fetched to
the worksheet. If this argument isn't specified, the setting of the
BackgroundQuery property determines the query mode.


--
Regards,
Tom Ogilvy

"Deeds" wrote in message
...
Thanks. Can I get you to ellaborate. Where do I make this setting? All

I have now is code that "refreshes data".


----- Tom Ogilvy wrote: -----

you have to set the Backgroundquery property of the query to False so

the
code will wait for the refresh to complete.

--
Regards,
Tom Ogilvy

"Deeds" wrote in message
...
I am having a big problem trying to 1st. unprotect a sheet, in the

same
code run "refresh all", then protect the sheet again. I keep getting

an
error like it is trying to "refresh" after the sheet is protected
again...Can anyone explain how I unprotect, refresh then protect

again?
Thanks





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
Protect, unprotect Pyrite Excel Discussion (Misc queries) 0 August 15th 08 03:18 PM
Protect/Unprotect Worksheet djn Excel Discussion (Misc queries) 1 May 12th 05 11:27 PM
Is there any way that you can protect or unprotect a group of wor. CheriT63 Excel Discussion (Misc queries) 9 January 8th 05 08:40 PM
Protect/unprotect all worksheets Janna Excel Worksheet Functions 2 January 7th 05 01:01 AM
Protect\Unprotect VBA project Rohit Thomas Excel Programming 2 August 28th 03 04:16 PM


All times are GMT +1. The time now is 03:53 PM.

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

About Us

"It's about Microsoft Excel"