Error message on Opening

  • Thread starter Thread starter Noepie
  • Start date Start date
N

Noepie

Hello,

I get an error message on opening a workbook when the sheet "Invoer" is not
active. If it is then the error message doesn't occur. The code is as follows:
__________
Private Sub Workbook_Open()
With Application
Sheets("Portefeuille").Range("Data").ClearContents
Sheets("Invoer").Range("e3").Select
End With
End Sub
___________
Does anyone know what goes wrong.

Regards,

Noepie
 
If you're selecting a range on a sheet, that sheet needs to be active first.
Try adding this in the appropriate location.

Sheets("Invoer").Select
 
Back
Top