D
dim
Hi folks,
I have a workbook called Book2. A macro opens Book2, inserts and saves user
data, then closes Book2.
This all worked fine until I just tried it out with the password applied to
Book2. the password is "pswd". When the code attempts to insert a row into
Book2's sheet as below, it hangs because it cant insert a row when all the
cells are locked. I thought this might happen, thats why I tested it now. But
I dont know the VBA code I need....
Rows("2:2").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Can someone please tell me what to add to the code to unprotect the sheet
using the password, then reprotect it before saving and closing?
Thankyou.
I have a workbook called Book2. A macro opens Book2, inserts and saves user
data, then closes Book2.
This all worked fine until I just tried it out with the password applied to
Book2. the password is "pswd". When the code attempts to insert a row into
Book2's sheet as below, it hangs because it cant insert a row when all the
cells are locked. I thought this might happen, thats why I tested it now. But
I dont know the VBA code I need....
Rows("2:2").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Can someone please tell me what to add to the code to unprotect the sheet
using the password, then reprotect it before saving and closing?
Thankyou.