#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Main first

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Main first

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!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Main first

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!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Main first

You could rename it Auto_Open.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"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!



  #5   Report Post  
Posted to microsoft.public.excel.programming
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!








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Main first

Which is probably where her code is Nick.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"NickHK" wrote in message
...
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!







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Main history of car insurance phoplevet Excel Discussion (Misc queries) 1 October 27th 08 04:07 PM
Main history of car insurance phoplevet Excel Discussion (Misc queries) 0 October 27th 08 02:15 AM
Main and subject spreadsheets Mark D. Brown, MSW Setting up and Configuration of Excel 2 December 30th 05 02:57 PM
Call from a Main program Haim[_2_] Excel Programming 4 September 24th 04 08:09 PM
New Main menu item Cynthia[_4_] Excel Programming 7 May 9th 04 12:35 AM


All times are GMT +1. The time now is 12:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"