[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 387
  • Last Modified:

Sub Main

Hi,

   How to declare a sub main function,
   I using ActiveX exe project.

Thanks
0
seahpc
Asked:
seahpc
1 Solution
 
phiroCommented:
Include a module with in it a sub called "Main()"
The Main sub should reside in a module, not in a form or class module !

For instance :

Public sub Main()

End sub

****

Now do not forget to set the property of the project properties : Tab general, set the startup project to sub main.
0
 
alokanantCommented:
Add a module and add the following declaration -
private sub main
' your code here
end sub

i think you shall be placing code for initialising global variables or constants, in this.

hth
alok.
0
 
danelroismanCommented:
Add standard module to you project

Insert code to module:
 
Sub main()
  'Your code
End Sub

Go to:
"Project->Project Properties" menu
and change  "Startup Object" to "Sub Main"


Run the Project

Enjoy!

Daniel
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now