Protected Worksheet 1004 error while running macro to import data

D

dtg_denver

I created a macro to import a csv file. The macro runs fine until I protect
the worksheet then it throws off a run time error 1004. I tried enabling all
the options for protection and this does not fix it. However, if I un-protect
the worksheet it runs like a dream. Help?
 
K

Kassie

Hi

Use ActiveSheet.Unprotect when starting the macro, and end the macro with
ActiveSheet.Protect. You can specify a password if you wish, for what that's
worth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top