PC Review


Reply
Thread Tools Rate Thread

Auto Refresh and Protecting a Sheet

 
 
eighthman11
Guest
Posts: n/a
 
      16th Apr 2008
Hello Everyone,

Using excel 2003.

Quick Question - I have an excel spreadsheet that is "sheet
protected". I have an ODBC connection that refreshes the spreadsheet
when it is opened, so in the On_Open event of the
workbook I have code to unprotect the sheet so the refresh will work.

Here's the question. Where in the world can I place the code to
reprotect the workbook after the
user clicks the "Enable automatic refresh' button. Any help
appreciated. Thanks Ray


 
Reply With Quote
 
 
 
 
Alex Simmons
Guest
Posts: n/a
 
      17th Apr 2008
On Apr 16, 9:46*pm, eighthman11 <rdshu...@nooter.com> wrote:
> Hello Everyone,
>
> Using excel 2003.
>
> Quick Question - I have an excel spreadsheet that is "sheet
> protected". *I have an ODBC connection that refreshes the spreadsheet
> when it is opened, so in the On_Open event of the
> workbook I have code to unprotect the sheet so the refresh will work.
>
> Here's the question. *Where in the world can I place the code to
> reprotect the workbook after the
> user clicks the "Enable automatic refresh' button. *Any help
> appreciated. *Thanks Ray


Ray,

Could you copy your code so we can see what the automatic refresh
does? Ie how often it refreshes and so on? It'll be much easier to see
what you're asking then.

Regards,

Alex
 
Reply With Quote
 
eighthman11
Guest
Posts: n/a
 
      17th Apr 2008
On Apr 17, 5:27*am, Alex Simmons <simm...@gmail.com> wrote:
> On Apr 16, 9:46*pm,eighthman11<rdshu...@nooter.com> wrote:
>
> > Hello Everyone,

>
> > Using excel 2003.

>
> > Quick Question - I have an excel spreadsheet that is "sheet
> > protected". *I have an ODBC connection that refreshes the spreadsheet
> > when it is opened, so in the On_Open event of the
> > workbook I have code to unprotect the sheet so the refresh will work.

>
> > Here's the question. *Where in the world can I place the code to
> > reprotect the workbook after the
> > user clicks the "Enable automatic refresh' button. *Any help
> > appreciated. *Thanks Ray

>
> Ray,
>
> Could you copy your code so we can see what the automatic refresh
> does? Ie how often it refreshes and so on? It'll be much easier to see
> what you're asking then.
>
> Regards,
>
> Alex


Alex,
I did an "Import Data" from the "Data" tab and then clicked on the
"Data Range Property" so I could select to have the spreadsheat
refreshed when it is opened. The spreadsheet is protected so I had to
unprotect it with code when the spreadsheet is opened. Now after the
refresh I need to reprotect it but I don't know where to place the
code.
 
Reply With Quote
 
Alex Simmons
Guest
Posts: n/a
 
      17th Apr 2008
On Apr 17, 5:19*pm, eighthman11 <rdshu...@nooter.com> wrote:
> On Apr 17, 5:27*am, Alex Simmons <simm...@gmail.com> wrote:
>
>
>
> > On Apr 16, 9:46*pm,eighthman11<rdshu...@nooter.com> wrote:

>
> > > Hello Everyone,

>
> > > Using excel 2003.

>
> > > Quick Question - I have an excel spreadsheet that is "sheet
> > > protected". *I have an ODBC connection that refreshes the spreadsheet
> > > when it is opened, so in the On_Open event of the
> > > workbook I have code to unprotect the sheet so the refresh will work.

>
> > > Here's the question. *Where in the world can I place the code to
> > > reprotect the workbook after the
> > > user clicks the "Enable automatic refresh' button. *Any help
> > > appreciated. *Thanks Ray

>
> > Ray,

>
> > Could you copy your code so we can see what the automatic refresh
> > does? Ie how often it refreshes and so on? It'll be much easier to see
> > what you're asking then.

>
> > Regards,

>
> > Alex

>
> Alex,
> I did an "Import Data" from the "Data" tab and then clicked on the
> "Data Range Property" so I could select to have the spreadsheat
> refreshed when it is opened. *The spreadsheet is protected so I had to
> unprotect it with code when the spreadsheet is opened. *Now after the
> refresh I need to reprotect it but I don't know where to place the
> code.


It should be the last part of the procedure - just add something like:

Worksheets("Sheet1").Protect "password"

Which will then re-protect the sheet.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
protecting formulas without protecting sheet so grouping still wor JM Microsoft Excel Misc 1 4th Jun 2009 06:42 AM
Copy Excel functions formula and auto refresh refresh Pauline Cheong Microsoft Excel Worksheet Functions 3 16th Feb 2009 01:23 AM
how can I auto refresh pivot table with sheet protection israel.a.juarez@andrew.com Microsoft Excel Misc 0 12th Nov 2008 10:34 PM
Sheet protection code conflicts with Pivot Table "auto refresh" =?Utf-8?B?S0c=?= Microsoft Excel Misc 6 21st Dec 2005 11:16 PM
Auto Protecting cells & auto filling date ccarmock Microsoft Excel Misc 7 30th Sep 2005 09:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:04 AM.