Hi all,
I have a problem making my program open on a specific worksheet, as I get a 1004 error and the text "Method activation of class Worksheet error". This only happens when I put my code in a Workbook_Open sub like this:
However when I use it in a normal way, I have no problem going to that specific worksheet and Range:
Does anyone know why I get this error? I have been looking all over the web for explanations, but most of them concerned copy/paste codes, so I figured that wasn't what I'm looking for. Thanks in advance.
PS.
I'm not sure if I posted the code correctly this way, this is my first thread on this forum. If anything's wrong with this post, please let me know
I have a problem making my program open on a specific worksheet, as I get a 1004 error and the text "Method activation of class Worksheet error". This only happens when I put my code in a Workbook_Open sub like this:
Code:
Sub Workbook_Open()
With Application
.DisplayFullScreen = True
.DisplayFormulaBar = False
.Calculation = xlAutomatic
End With
ThisWorkbook.Worksheets("General Data").Activate
Range("D3").Select
End Sub
However when I use it in a normal way, I have no problem going to that specific worksheet and Range:
Code:
Sub GotoGeneralData()
Worksheets("General Data").Activate
Range("D3").Select
End Sub
Does anyone know why I get this error? I have been looking all over the web for explanations, but most of them concerned copy/paste codes, so I figured that wasn't what I'm looking for. Thanks in advance.
PS.
I'm not sure if I posted the code correctly this way, this is my first thread on this forum. If anything's wrong with this post, please let me know