Thread: Main first
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Main first

Jenni,
As Bob pointed you can rename "Auto-Open" to achieve the same, although
Workbook_Open fires first.
And a "Auto-Open" routine needs to be in a module, not in a worksheet or
ThisWorkbook.

NickHK

"Jenni_Sweden" wrote in message
...
thankx. but how do you specify where the program begins? as it is now i am
not sure where in the code the program starts running!
--
I am very thankful for any fast assistance!


"NickHK" skrev:

Jenni,
"Sub Main" has no special meaning in VBA as it does in VB standalone.
But in the Workbook_Open event you can call it, or any other

sub/function
you wish.
e.g. Call Main()

NickHK

"Jenni_Sweden" wrote in message
...
How do I get my program to start at the subroutine main? (I have

Visual
Basic
6.3). My code is:
Public Sub Main()
Public lengthDate As Integer
Worksheets("Indata").Range("f9") = "main"
dagensDatumKnapp.Show
skapa
End Sub
End Sub

In main I want to create certain things e.g. display text in a cell.

However
main is nerevr executed? Help!