• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Interesting VBA technique

kevinthenerd

Platinum Member
I've read online in several different forums that people (usually n00bs) want to make stand-alone applications with VBA. While I haven't come up with that necessarily, I do have a technique to offer that will work if you do have an appropriate version of Office installed. It's very simple:

Write code that runs when the file is opened. End the opening subroutine with an exit command. It's an ugly flash on the screen, but for certain tasks that I do at work, it's perfect.

(I have a short little script that I run in VBA for Excel that reads some information from the clipboard, processes it to be more useful for my work, and sends the result back to the clipboard. Having this whole process automated, without hitting a button, is a nice thing to have. I have a shortcut to it in my PATH directory so I can run it from the Run command. I use the run command, accessible with Win-R, to load just about every application.)

Here's the code snippet for Excel if you're interested. It's stupidly simple. Be sure to open your file with macros disabled if you ever want to edit it.

Private Sub Workbook_Open()
MsgBox "This is how to effectively make a stand-alone application in VBA."
Application.DisplayAlerts = False
Application.Quit
End Sub

I'm sure almost everyone on here has a much more elegant and geeky way to get these sorts of things done, but this works quite well for me.
 
Back
Top