I have an MSFlexgrid on a form in an Access XP database. I would like to export the data in the grid to Excel. I know how to do this in VB, but I am not sure if the same code can be used in Access. When I try it, it gives me run-time error 381 - Subscript out of range

VB Code:
  1. Private Sub cmdExport_Click()
  2.     On Error Resume Next
  3.     Dim xLApp As Excel.Application
  4.     Dim xLWB As Excel.Workbook
  5.     Dim xLSH As Excel.Worksheet
  6.     Dim RowCounter As Integer
  7.     Dim ColCounter As Integer
  8.    
  9.      'open Excel application
  10.     Set xLApp = CreateObject("Excel.application")
  11.     'Create Excel workbook
  12.     xLApp.Workbooks.Add
  13.     Set xLWB = xLApp.Workbooks(1)
  14.  
  15.     'Using Sheet 1
  16.     Set xLSH = xLWB.Worksheets(1)
  17.     For RowCounter = 0 To 44
  18.         For ColCounter = 0 To 1
  19.         With grdPlans
  20.              xLSH.Cells((StartRow + RowCounter) - 1, (StartCol + ColCounter) - 1).Value = _
  21.             .TextMatrix(RowCounter - 1, ColCounter - 1) & " "
  22.         End With
  23.         Next
  24.     Next
  25.    
  26.     xLWB.SaveAs (App.Path & "\Plan.xls")
  27.    
  28.     xLWB.Close
  29.     xLApp.Quit
  30.    
  31.     Set xLWB = Nothing
  32.     Set xLApp = Nothing
  33. End Sub

Is there a way to do this?