title: How to run VBScript GetObject while the computer is locked?
body: <p>For a few reasons discussed <a href="https://stackoverflow.com/questions/25022266/opening-an-excel-file-manually-allows-formulas-to-run-opening-an-excel-file-wit">here</a> I can't open an excel worksheet like this:</p>
  
  <pre><code>Set excel = CreateObject("Excel.Application")
  Set workbook = excel.Workbooks.Open(file_path.xls)
  excel.Visible = True
  </code></pre>
  
  <p>So I'm trying to open it like this:</p>
  
  <pre><code>CreateObject("WScript.Shell").Run "excel.exe"
  WScript.Sleep 5000
  
  CreateObject("WScript.Shell").Run "excel.exe"
  WScript.Sleep 5000
  
  Set excel = GetObject(,"Excel.Application")
  Set workbook = excel.Workbooks.Open( excel_file_path, 3) 
  excel.Visible = True
  </code></pre>
  
  <p>This runs just fine when my computer isn't locked. And usually VBScripts can run even when a computer is locked. However, only when the computer is locked, at the line <code>GetObject(,"Excel.Application")</code> I get the following runtime error:</p>
  
  <pre><code>Error:  ActiveX component can't create object: 'GetObject'
  Code:   800A01AD
  Source: Microsoft VBScript runtime error
  </code></pre>
  
  <p>I tried changing my Windows 7 settings to never lock after some inactivity, but my company's IT department has enforced that setting.</p>
  
  <p>Is there a way to run this script from a locked screen, or is there an alternative you recommend?</p>
  
  <p>Edit:</p>
  
  <p>It has something to do with the way the excel file is being opened... If I open a new blank excel page than lock the screen, <code>GetObject</code> will work just fine getting that document, but if I open it using the shell then log out, it won't...</p>