ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protect Microsoft Query (https://www.excelbanter.com/excel-programming/303438-protect-microsoft-query.html)

don

Protect Microsoft Query
 
I am inporting data using a query.
Is there a way of protecting that query so a user cannot
modify it?
It appears that anyone can go to Dataedit query and
change it.
Thanks - Don

jjames

Protect Microsoft Query
 
Have you had any luck with this?

--
Message posted from http://www.ExcelForum.com


Dick Kusleika[_3_]

Protect Microsoft Query
 
Don

Protecting the sheet will protect the query. Tools - Protection - Protect
Sheet.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Don" wrote in message
...
I am inporting data using a query.
Is there a way of protecting that query so a user cannot
modify it?
It appears that anyone can go to Dataedit query and
change it.
Thanks - Don




don

Protect Microsoft Query
 
Thanks - However, I stil need them to be able to refresh
the data. Protecting the sheet disables that command.

Thanks - Don
-----Original Message-----
Don

Protecting the sheet will protect the query. Tools -

Protection - Protect
Sheet.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Don" wrote in

message
...
I am inporting data using a query.
Is there a way of protecting that query so a user

cannot
modify it?
It appears that anyone can go to Dataedit query and
change it.
Thanks - Don



.


don

Protect Microsoft Query
 
Not yet.
I don't care if the user manipulates the data, I just
don't want them to change the query.

-----Original Message-----
Have you had any luck with this??


---
Message posted from http://www.ExcelForum.com/

.


Dick Kusleika[_3_]

Protect Microsoft Query
 
Don

Two options that I see. You can disable all the ways that the user can get
to edit query. Consider putting this in the sheet activate event and then
re-enable them in the sheet deactivate event

Dim cbcs As CommandBarControls
Dim cbc As CommandBarControl

Set cbcs = Application.CommandBars.FindControls(, 1950)

For Each cbc In cbcs
cbc.Enabled = False
Next cbc

Another option is to code your own Refresh button and protect the sheet.
The regular Refresh button, along with the Edit Query button, will be
disabled and the user will have to use your Refresh button.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Don" wrote in message
...
Thanks - However, I stil need them to be able to refresh
the data. Protecting the sheet disables that command.

Thanks - Don
-----Original Message-----
Don

Protecting the sheet will protect the query. Tools -

Protection - Protect
Sheet.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Don" wrote in

message
...
I am inporting data using a query.
Is there a way of protecting that query so a user

cannot
modify it?
It appears that anyone can go to Dataedit query and
change it.
Thanks - Don



.




don

Protect Microsoft Query
 
Thanks - I will try those

-----Original Message-----
Don

Two options that I see. You can disable all the ways

that the user can get
to edit query. Consider putting this in the sheet

activate event and then
re-enable them in the sheet deactivate event

Dim cbcs As CommandBarControls
Dim cbc As CommandBarControl

Set cbcs = Application.CommandBars.FindControls(, 1950)

For Each cbc In cbcs
cbc.Enabled = False
Next cbc

Another option is to code your own Refresh button and

protect the sheet.
The regular Refresh button, along with the Edit Query

button, will be
disabled and the user will have to use your Refresh

button.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Don" wrote in

message
...
Thanks - However, I stil need them to be able to

refresh
the data. Protecting the sheet disables that command.

Thanks - Don
-----Original Message-----
Don

Protecting the sheet will protect the query. Tools -

Protection - Protect
Sheet.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Don" wrote in

message
...
I am inporting data using a query.
Is there a way of protecting that query so a user

cannot
modify it?
It appears that anyone can go to Dataedit query and
change it.
Thanks - Don


.



.



All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com