run time error 1004 on protected worksheet when I try to run m
Thanks for the input. However, it looks like I'm in way over my head. I
wouldn't know how to add the code you just suggested. I can record a simple
macro and that is about it.
"Vasant Nanavati" wrote:
Yes, you have to provide the password.
Worksheets("MySheet").Unprotect Password:="PW"
You have to reprotect it the same way.
Alternatively, you may want to protect the worksheet (you can only do this
through code) with the UserInterfaceOnly parameter set to True. This will
prohibit manual changes but will allow a macro to make changes.
--
Vasant
"dtg_denver" wrote in message
...
Great idea, however the macro won't unprotect the sheet without manually
putting in the password. It will re-protect it though.
"Dave Peterson" wrote:
Have your macro unprotect the worksheet, do the import, and reprotect the
workbook.
dtg_denver wrote:
I created a macro to import a csv data file. The macro works fine when
the
worksheet in unprotected. When I protect the worksheet and click on the
macro
button I get a run time erro 1004. I have tried protecting the
worksheet with
all the options checked off, but I still get the error. Any idea would
be
helpful.
--
Dave Peterson
|