ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem doing Query to Access with Excel sheet protected (https://www.excelbanter.com/excel-programming/323996-problem-doing-query-access-excel-sheet-protected.html)

Harry[_8_]

Problem doing Query to Access with Excel sheet protected
 
Hello All

Subject sort of says it all. I have a macro that does an MSQUERY to an Access database, prompts for a company name,
pulls the record with the matching company name into the Excel sheet into the appropriate row. However, it is not
working with the sheet protected. The cells being written to are not locked or hidden. I'm not sure if it is the query
not getting done, or the writing of the data to the Excel sheet.

Thank you

Harry


Tom Ogilvy

Problem doing Query to Access with Excel sheet protected
 
Since your posting in programming,
in your code,
unprotect the sheet
do the query
protect the sheet.

--
Regards,
Tom Ogilvy

"Harry" wrote in message
.. .
Hello All

Subject sort of says it all. I have a macro that does an MSQUERY to an

Access database, prompts for a company name,
pulls the record with the matching company name into the Excel sheet into

the appropriate row. However, it is not
working with the sheet protected. The cells being written to are not

locked or hidden. I'm not sure if it is the query
not getting done, or the writing of the data to the Excel sheet.

Thank you

Harry




Harry[_8_]

Problem doing Query to Access with Excel sheet protected
 
Unprotect it as in doing it in the macro...adding it to the existing code?

Harry


On Thu, 24 Feb 2005 22:08:24 -0500, "Tom Ogilvy" wrote:

Since your posting in programming,
in your code,
unprotect the sheet
do the query
protect the sheet.

--
Regards,
Tom Ogilvy

"Harry" wrote in message
. ..
Hello All

Subject sort of says it all. I have a macro that does an MSQUERY to an

Access database, prompts for a company name,
pulls the record with the matching company name into the Excel sheet into

the appropriate row. However, it is not
working with the sheet protected. The cells being written to are not

locked or hidden. I'm not sure if it is the query
not getting done, or the writing of the data to the Excel sheet.

Thank you

Harry





Tom Ogilvy

Problem doing Query to Access with Excel sheet protected
 
Yes.

Activesheet.Unprotect Password:="ABCD"
' do the query
Activesheet.Protect Password:="ABCD"
--
Regards,
Tom Ogilvy

"Harry" wrote in message
.. .
Unprotect it as in doing it in the macro...adding it to the existing code?

Harry


On Thu, 24 Feb 2005 22:08:24 -0500, "Tom Ogilvy" wrote:

Since your posting in programming,
in your code,
unprotect the sheet
do the query
protect the sheet.

--
Regards,
Tom Ogilvy

"Harry" wrote in message
. ..
Hello All

Subject sort of says it all. I have a macro that does an MSQUERY to an

Access database, prompts for a company name,
pulls the record with the matching company name into the Excel sheet

into
the appropriate row. However, it is not
working with the sheet protected. The cells being written to are not

locked or hidden. I'm not sure if it is the query
not getting done, or the writing of the data to the Excel sheet.

Thank you

Harry








All times are GMT +1. The time now is 06:28 AM.

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