Running macro @ startup with multiple modules

Dale Dunn graciously provided me with a tip to start a macro upon startup of SW by adding this to the shortcut target "C:\Program Files\SolidWorks\SLDWORKS.exe" /m "G:\users\cds\Working
Macros\Events.swp"
The problem I have run into is I added a few Modules and now it is running the wrong function Instead of Module1.Main I am getting Get_User_Name.GetUserName, Is there a way to specify Module1.Main or to specify which function runs automatically, say, in the code or preferences or something
TIA
Corey Scheich
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Im not sure if there is, but that would sure be handy

Try moving your Sub Main to be the LAST sub/function in the module.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
One possibility...
One quirk I found with SW macros is that the code for "Sub Main()" has to be at the bottom of the module it is in.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Didn't I read that's supposed to be fixed in '04?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I am running 2003, and that worked but I had to move it to the module that was being run and move it to the bottom. How does it decide which module to look for Sub Main() in. I had it in Module1 and it was the only procedure in there. I haven't tested 2004.
Corey

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
A shade off topic... Does anyone know if there are any other "undocumented" command line switches that could be usefull?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Macros do have their limitations in size and ability. If you want to monitor events and start automatically with SW, there's nothing like an addin: smaller, faster, and cleaner, plus the ability to add toolbars and menus.
I am putting together a presentation on making an addin from a VB .exe for our user group meeting (Milwaukee, WI, USA) March 4. This involves taking a simple VB .exe and adding one class module (well annotated with hints and explanations) plus a .res file for toolbar bitmaps (this will also be demystified). The project will be posted the following weekend to my website, http://www.EsoxRepublic.com
Getting a full version of VB6 is well worth it. There are many advantages beyond just being able to compile. VB6 is fairly cheap, now that it is obsoleted by VB.net.
p.s. I know I owe someone out there a posting of a registry scrub utility. It's done, I just have to get it posted. It should be up this weekend if the family stays healthy!

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
FYI--
My presentation has been preempted and rescheduled for the fall Chicago-area combined user group meeting.
snipped-for-privacy@liquidschwarz.com (TheTick) wrote in message

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.