nicolaforni
11-12-2009, 06:10 AM
Hi,
If I save macro to refresh sheet2 starting from sheet1 this works fine.
Sheets("Sheet2").Select
Range("C4").Select
Application.Run "BLPLinkReset"
ActiveCell.FormulaR1C1 = "2"
Range("C5").Select
End Sub
If I add a command button and use it to run same code this does not work.
I get error message:
Run-time error '1004' Select method of Range class failed.
Private Sub CommandButton1_Click()
Sheets("Sheet2").Select
Range("C4").Select
Application.Run "BLPLinkReset"
ActiveCell.FormulaR1C1 = "2"
Range("C5").Select
End Sub
Why is it that the same code does not work using the command button?
:dunno
Thanks!
Nick
If I save macro to refresh sheet2 starting from sheet1 this works fine.
Sheets("Sheet2").Select
Range("C4").Select
Application.Run "BLPLinkReset"
ActiveCell.FormulaR1C1 = "2"
Range("C5").Select
End Sub
If I add a command button and use it to run same code this does not work.
I get error message:
Run-time error '1004' Select method of Range class failed.
Private Sub CommandButton1_Click()
Sheets("Sheet2").Select
Range("C4").Select
Application.Run "BLPLinkReset"
ActiveCell.FormulaR1C1 = "2"
Range("C5").Select
End Sub
Why is it that the same code does not work using the command button?
:dunno
Thanks!
Nick