View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Pause/Delay to Import Data, then Apply Protection to Sheet

Just wondering if there is a way to load info into a worksheet, then pause
for a few moments, and then apply protection to a specific sheet so users
cant delete rows in this sheet. I cant import the information with
protection on the sheet. I looked though many helpful topics on this DG, but
the answer is eluding me.


I have code in a module that loads the data into the sheet. I placed a
Private Sub behind the worksheet itself. Below is the code that I was
mulling over; doesnt seem to do what I wanted it to do. Does anyone have
any ideas as to how to proceed? Excel may not permit this activity. I can't
tell for sure...


Private Sub my_Procedure()

Application.OnTime Now + TimeValue("00:00:10"), "my_Procedure"

ActiveSheet.Protect DrawingObjects:=False, Contents:=True,
Scenarios:= _
False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True,
AllowInsertingRows _
:=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _
AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True


End Sub


--
RyGuy