If I create a new form from scratch, where is the MainForm.Show being called from? In other words, when I hit F5, where is this happening?
If I create a new form from scratch, where is the MainForm.Show being called from? In other words, when I hit F5, where is this happening?
Within the executable code of the VB run time.
Remember what the dormouse said
Feed your head
Userforms are Application objects, just like ThisWorkbook, Sheet1, Sheet2, Module1, etc. When you execute the UserForm.Show command, the application looks for that object in the Pruject list. If you open the vb editor (Alt + F11) you can see the Project list in the upper left corner of the editor window. If a userform of the name specified exists in the Project list, it will become visible on the screen. You can get more detailed information by doing a web search on 'Excel UserForms'.
Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
Just when I think I am smart, I learn something new!
The basic userform that you insert to build your custom userform is an application item. That means that it is part of the underlying VBA software which is generally not accessible by the user, since it is proprietary to Microsoft.
Why are you running your form by selecting and pressing f5? Add a routine that shows it using the Show method, and specify the argument. You can also set the form's ShowModal property to false.
No, not these days. Why use Excel at all if you want an .exe?
Then you are out of luck on that front. You could make its containing workbook into an add-in. I can't say if that would help without knowing why you want it to be an executable.
try bat2exe by igor whatshisface - great utility to get a directory with all the goodies you like into exe with a batch script to run what you want from it. but be sure to map the folder to local and copy out of temp, give it unique name
Put this in a normal code module
Then you can call the sub (and show the userform) either from the Macro dialog box or assign it to a button.Please Login or Register to view this content.
Add the modeless argument if that is what you want.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
At what point are you opening the file you are going to modify?
Are you opening it with code run from the userform?
If you are I can't see why you can't do that, modify the file and then close the file, all using code in the userform module.
If posting code please use code tags, see here.
I think that just getting to understand how Excel works might be the best solution. VBA is a powerful tool to use in conjuction with the built in facilities of Excel. But don't rely on Excel for graphics. While Excel has drawing capabilities, it is not a graphics application the graphics it uses are very imprecise. But they are good enough for general use in gussying up your worksheets.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks