title: What do the hash signs in #if, #else, #end if mean?
body: <p>I'm writing code to check if a file is available to be checked out of SharePoint and, if it isn't, alert the user and tell them that the file is in use by someone else and who has it in use.</p>
  
  <p>I came across a piece of code at <a href="http://www.xcelfiles.com/IsFileOpen.html#anchor_37" rel="nofollow noreferrer">http://www.xcelfiles.com/IsFileOpen.html#anchor_37</a></p>
  
  <p>The code seems to work in test scenarios so I am planning to adapt it for my purposes. I'm having trouble understanding some of the syntax.</p>
  
  <pre><code>#If Not VBA6 Then
  
  '// Xl97
  
  For i = j - 1 To 1 Step -1
  
      If Mid(strXl, i, 1) = Chr(0) Then Exit For
  
  Next
  
  i = i + 1
  
  #Else
  
  '// Xl2000+
  
  i = InStrRev(strXl, strFlag1, j) + Len(strFlag1)
  
  #End If
  </code></pre>
  
  <p>I understand what the code does but I don't get the significance of the '#' symbol. </p>
  
  <p>Another example:</p>
  
  <pre><code>hdlFile = FreeFile
  
  Open strPath For Binary As #hdlFile
  
  strXl = Space(LOF(hdlFile))
  
  Get 1, , strXl
  
  Close #hdlFile
  </code></pre>
  
  <p>It is a pain to google because it is so vague.</p>