title: Excel automation isn't working in C++Builder XE7
body: <p>I am trying to use the code below to open an .xlsx file from C++Builder in RAD Studio XE7:</p>
  
  <pre><code>#include "ComObj.hpp"
  
  Variant Excel = CreateOleObject("Excel.Application");
  Variant Books = Excel.OlePropertyGet("Workbooks");
  Excel.OlePropertySet("Visible", true);
  // An escape character is missing but the problem remains
  Books.OleProcedure("Open", L"D:\1.xlsx"); // exception here
  </code></pre>
  
  <p>But the last line causes exception with message:</p>
  
  <p>Project2.exe raised exception class EOleException with message 'Unfortunately, we were unable to find the file TRUE.xlsx. It may have been moved, renamed or deleted?'.</p>
  
  <p><a href="https://i.stack.imgur.com/JRJ7Q.png" rel="nofollow noreferrer">Screen with place where the source breaks</a></p>
  
  <p>The code in Delphi seems to work fine:</p>
  
  <pre><code>uses ComObj;
  
  var
    Excel, Books: Variant;
  begin
      Excel := CreateOleObject('Excel.Application');
      Books := Excel.Workbooks;
      Excel.Visible := True;
      Books.Open('D:\1.xlsx'); // code passes
  end;
  </code></pre>
  
  <p>Does anyone know the solution?</p>
  
  <p><strong>Update1:</strong>
  The following code in VB also works fine:</p>
  
  <pre><code>Sub Button1_Click()
   Dim xlApp As Excel.Application
   Dim xlBooks As Excel.Workbooks
  
   Set xlApp = CreateObject("Excel.Application")
   Set xlBooks = xlApp.Workbooks
  
   xlApp.Visible = True
   xlBooks.Open ("D:\1.xlsx")
  End Sub
  </code></pre>
  
  <p><strong>Update2:</strong>
  Sending a raw string literal causes the same <a href="https://i.stack.imgur.com/m0Fb0.png" rel="nofollow noreferrer">exception</a>.</p>
  
  <p><code>Books.OleProcedure("Open", uR"(D:\1.xlsx)");</code></p>
  
  <p>It also doesn't seem to be an environment problem. I tested the example at several computers with no effect.</p>