FrymanSMU
05-13-2009, 12:21 PM
I keep getting an Excel error when I run the following code. The external data query is extrememly large and the macro does not seem to be waiting for the data to refresh.
Error Message: The cell or chart you are trying to change is protected and therefore read-only.
Any suggestions much appreicated.
Thanks,
Rich
Sub Button17_Click()
'On Error Resume Next
Application.ScreenUpdating = False
Sheets("RTS_Details").Visible = True
Sheets("Daily_Report").Visible = False
Sheets("User_Report").Visible = False
Sheets("RTS_Details").Select
Sheets("RTS_Details").Unprotect
Range("H16").Select
Selection.QueryTable.Refresh BackgroundQuery:=True
Range("F5").Select
Selection.AutoFill Destination:=Range("F5:F15000"), Type:=xlFillValues
Range("H5").Select
Selection.AutoFill Destination:=Range("H5:H15000"), Type:=xlFillValues
Sheets("RTS_Details").Select
Sheets("RTS_Details").Protect
Application.ScreenUpdating = True
End Sub
Error Message: The cell or chart you are trying to change is protected and therefore read-only.
Any suggestions much appreicated.
Thanks,
Rich
Sub Button17_Click()
'On Error Resume Next
Application.ScreenUpdating = False
Sheets("RTS_Details").Visible = True
Sheets("Daily_Report").Visible = False
Sheets("User_Report").Visible = False
Sheets("RTS_Details").Select
Sheets("RTS_Details").Unprotect
Range("H16").Select
Selection.QueryTable.Refresh BackgroundQuery:=True
Range("F5").Select
Selection.AutoFill Destination:=Range("F5:F15000"), Type:=xlFillValues
Range("H5").Select
Selection.AutoFill Destination:=Range("H5:H15000"), Type:=xlFillValues
Sheets("RTS_Details").Select
Sheets("RTS_Details").Protect
Application.ScreenUpdating = True
End Sub