title: Open Word Document Run-time error '424': Object required
body: <p>I have a set of functions in an Access database where I am generating Word documents based on a fixed template in a folder. </p>
  
  <p>I am doing this with the function shown below. For easier maintenance, I would like to be able to define the Word-template paths as public constants in the begining of my module. And therefore, I have been trying to create the adjusted function below.</p>
  
  <p>Original function:</p>
  
  <pre><code>Function MyFunc(rs as DAO.Recordset)
  Dim objWord As Object
  Dim objDoc As Object
  ...
  Set objWord = CreateObject("Word.Application")
  Set objDoc = objWord.Documents.Open("C:\test_template.docx")
  ...
  End Function
  </code></pre>
  
  <p>Adjusted function:</p>
  
  <pre><code>Public Const ReminderOneTemplate As Variant = "C:\test_template.docx"
  ...
  Function MyFunc(rs as DAO.Recordset)
  Dim objWord As Object
  Dim objDoc As Object
  ...
  Set objWord = CreateObject("Word.Application")
  </code></pre>
  
  <p>for the Word.Documents.Open method in the next, subsequent line of code I have tried this:</p>
  
  <pre><code>Set objDoc = objWord.Documents.Open(ReminderOneTemplate)
  ...
  End Function
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Set objDoc = objWord.Documents.Open(Chr(34) &amp; ReminderOneTemplate &amp; Chr(34))
  ...
  End Function
  </code></pre>
  
  <p>But the function keeps returning Run-time error '424' Object required when I use a constant as input to the Word.Documents.Open method.</p>
  
  <p>Can anyone explain why this is the case and what I am doing wrong. Is it not possible to pass a Constant to the Word.Open method?</p>
  
  <p>Thanks.</p>