Skip to content

Instantly share code, notes, and snippets.

@taka2
Created April 13, 2010 07:41
Show Gist options
  • Select an option

  • Save taka2/364398 to your computer and use it in GitHub Desktop.

Select an option

Save taka2/364398 to your computer and use it in GitHub Desktop.
stDate = now()
numcols = 100
numrows = 10000
Dim arr1
ReDim arr1(numrows - 1, numcols - 1)
For i = 0 To numrows - 1
For j = 0 To numcols - 1
arr1(i, j) = i * j
Next
Next
Set excelObj = CreateObject("Excel.Application")
Set workbooksObj = excelObj.Workbooks
Set workbookObj = workbooksObj.Add(1)
Set sheetObj = workbookObj.Sheets(1)
sheetObj.Range(sheetObj.Cells(1, 1), sheetObj.Cells(numrows, numcols)).Value = arr1
workbookObj.SaveAs "filename.xls"
workbookObj.Close()
excelObj.Quit()
msgbox stDate & "/" & now()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment