February 12th, 2013, 06:52 AM
How to extract on screen data.
I have this VB 6 application with about 400 records, it takes forever to extract to an excell sheet.
Is ther an easy way to get everything into a string or directly into excell? (Maybe clipboard and then Past it.)
I have Visual Basic Express installed.
February 13th, 2013, 12:48 PM
Re: How to extract on screen data.
I'm not sure if this applies. Just load the data into an array and copy to a range in excel
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim xlApp As Excel.Application
Dim ws As Excel.Worksheet
Dim wb As Excel.Workbook
Dim data(20, 20) As Double
Dim j, k As Integer
xlApp = New Excel.Application
xlApp.UserControl = True 'False
xlApp.Visible = True 'False
wb = xlApp.ActiveWorkbook
ws = wb.Worksheets(1)
For j = 0 To 20
For k = 0 To 20
data(j, k) = j * k
ws.Range("A1").Resize(20, 20).Value = data
Catch ex As Exception
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.