Protected Worksheet 1004 error while running macro to import data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
Back
Top