SOLVED - Run a .bat file when loading a form

SOLVED - Can be deleted :)

Hi there!

Problem! I made a journal this afternoon about how to get all the subfolders from a folder into a combobox, since there is no drivelistbox/drivecombobox in vba. Now i've managed to build a .bat file which automatically exports every mapname in a .txt file, but now I want to load that .bat file everytime I load the form the folders should be at.

[q]Private Sub UserForm_Activate()

herethecode

End Sub[/q]

So, to sum it up:
I want to run a .bat file everytime I load the coherent form.
Comments
6
Vba = visual basic for applications, really different from visual basic. I found it out on my own though, but thx anyways m8 :)

QuotePrivate Sub UserForm_Activate()

Shell "Cmd.exe /C ""C:\maphere\Folders.bat"""

End Sub
Parent
how is it different? I think you are mixing up VB.net and VB (6.0 or older), that are different idd.
Parent
nop, vba misses several functions, + some of the coding is different
Parent
Shell(run *.bat)
QuotePrivate Sub UserForm_Activate()

Shell "Cmd.exe /C ""C:\maphere\Folders.bat"""

End Sub
Parent
Back to top