Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running VBA application from command line

Status
Not open for further replies.

RufussMcGee

Technical User
Jan 7, 2005
117
US
Trying to program an Autocad custom to run my VBA application when the is clicked. Wrote this in my mnu file

^c-vbarun;C:\AutoCad_Custom\Programming\Shaft.dvb!Module1.Shaft;

The program is already loaded and the line code runs the VBA but the user form does not appear, but when I goto the VBA windowand click on the RUN button works fine.

Any suggestions?

Thanks.
 
Hi Rufuss,

How are you calling your user form in your Shaft module?

Todd
 
Hi Rufuss,

Try changing it to: Userform1.Show

Then your routine should work.

HTH
Todd
 
Works perfect. Okay so the module controls opening/loading of the VBA do I put error codes for textboxs in this point too or is that done in somewhere else?. In a nutshell if the user forgets to fill in one of the textbox that is required want a message box to appear telling them what they missed and close down or restart the userform to let them enter the missing data.

Thanks.
 
Hi Rufuss,

Error handling is as much of an art as it is a science, so take this with grain of salt, as there are probably at least a couple of different methodologies as well as philosophies to handle this.

I would add the error trapping in the "Ok" button (or whatever your action button happens to be) to scan the form for the proper information and then notify the user before I ever closed the form - but that's just my two cents.

HTH
Todd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top