title: Trying to convert 32-Bit Excel Macros into 64-Bit
body: <p>I'm trying to run an Excel loaded with multiple macros. It was written for a 32-Bit and work upgraded me to a 64-Bit to do Power BI reporting. </p>
  
  <p>The Excel macros are spitting out errors. I tried to use other threads to help me convert it. However I keep having the debugger come back to me about the last line.</p>
  
  <p>I found this comment on a <a href="https://stackoverflow.com/questions/45161901/converting-excel-macro-from-32-bit-to-64-bit">similar thread</a> and used it as a guideline to alter my code and was able to remove some of the data type errors I was being thrown. </p>
  
  <blockquote>
    <p>Manually add <code>PtrSafe</code> to all declarations. Manually convert all <code>Long</code>s in the declarations that represent pointers to <code>LongPtr</code>s (in the code shown, that would be only <code>pidl</code>). Manually update declarations of <code>Long</code> variables in procedures that are passed as these parameters to <code>LongPtr</code>. There's no other way. You may try to look into refactoring tools/addins that may automate the replacements to a degree.</p>
  </blockquote>
  
  <pre class="lang-vb prettyprint-override"><code>Set objmyconn = New ADODB.Connection
  Set Objmycmd = New ADODB. Connection
  Set obmyrecordset= New ADODB.Recordset
  objmyconn.ConnectionTImeout = 0 
  objmyconn.Open "DSN=UU####; uid=NAME; pwd:1234"
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>Run-time error '2147467259 (80004005)':
  </code></pre>