title: VBA copy cell range to public 2D array
body: <p>I'm using VBA with AutoCAD, and need to extract some data from an Excel Sheet.</p>
  
  <p>Basically I want to:</p>
  
  <ul>
  <li>Declare a public 2D string array: FULL_TABLE.</li>
  <li>At initialization open the excel document, get a cell range, then
  close the document.</li>
  <li>Put all the values from the cell range to the 2D string array
  FULL_TABLE</li>
  </ul>
  
  <p>What I have so far:</p>
  
  <p>Declared in Module 1:</p>
  
  <pre><code> Public FULL_TABLE() As String
  </code></pre>
  
  <p>Different module:</p>
  
  <pre><code>Private Sub UserForm_Initialize()
  
  'Excel Path
  Dim excelPath As String
  excelPath = "O:\myData.xls"
  
  'Open Excel File
  Set exapp = CreateObject("Excel.Application")
  exapp.Visible = False
  exapp.Workbooks.Open (excelPath)
  Set wsheet = exapp.ActiveSheet
  
  'Get cell values
  'privateFULL_TABLE is not public and can only be accessed here
  'If I try to add values to FULL_TABLE (public) I get errors
  
  Dim privateFULL_TABLE As Variant 
  privateFULL_TABLE = wsheet.Range("B5:AV50")
  
  'here I can access values correctly from privateFULL_TABLE
  
  'Close File
  exapp.Quit
  Set exapp = Nothing
  
  End Sub
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <p>How can I convert a range of cells to public 2D string array?</p>