title: Opening a VBA UserForm using VBScript?
body: <p>So I've been working on a project in Excel that creates a UserForm in order to run three different macros. The Userform has been created but the issue I'm facing right now is that whenever I use a script.vbs to open the macro from outside Excel, it closes instantly. I want the UserForm to stay on the screen. Any ideas on how to do this?</p>
  
  <p>Here is the VBS script I'm using.</p>
  
  <pre><code>Dim xlApp, xlBook
  
  Set xlApp = CreateObject("Excel.Application")
  Set xlBook = xlApp.Workbooks.Open("Path~", True)
  xlApp.Run "ThisWorkbook.UserForm"
  xlBook.Close
  xlApp.Quit
  
  Set xlBook = Nothing
  Set xlApp = Nothing
  
  WScript.Quit
  </code></pre>
  
  <p>Here is the Macro code for the Userform.</p>
  
  <pre><code>Sub UserForm()
  
  Dim form As New Userform1
  
  form.Show vbModal
  
  End Sub
  </code></pre>
  
  <p>UPDATE: Never mind. I'm an idiot. The solution is to make sure your Excel file is readable, then run it from administrator.</p>