-
February 12th, 2013, 06:52 AM
#1
How to extract on screen data.
Hello
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.
Thank you
-
February 13th, 2013, 12:48 PM
#2
Re: How to extract on screen data.
Hi,
I'm not sure if this applies. Just load the data into an array and copy to a range in excel
Code:
Imports Microsoft.Office.Interop
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
Try
xlApp = New Excel.Application
xlApp.UserControl = True 'False
xlApp.Visible = True 'False
xlApp.Workbooks.Add()
wb = xlApp.ActiveWorkbook
ws = wb.Worksheets(1)
For j = 0 To 20
For k = 0 To 20
data(j, k) = j * k
Next k
Next j
ws.Range("A1").Resize(20, 20).Value = data
Catch ex As Exception
End Try
End Sub
End Class
Curt
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|