| | |
Excel in VB 6
![]() |
•
•
Join Date: Jul 2007
Posts: 2
Reputation:
Solved Threads: 0
How do I insert an Excel file into VB 6. I need to be able to view the file in a seperate form. I know the coding to change the forms is
And I read a previous thread before on these forums that gave me the coding to load it:
Could anyone please help me to find what the solution so the Excel spreadsheet may be displayed on the form?
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Form1.Hide Form2.Show
And I read a previous thread before on these forums that gave me the coding to load it:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim xlTmp As Excel.Application Set xlTmp = New Excel.Application xlTmp.Workbooks.Open App.Path & "\times.xls"
Could anyone please help me to find what the solution so the Excel spreadsheet may be displayed on the form?
Dim xlApp As Excel.Application
Dim wb As Workbook
Dim ws As Worksheet
Dim i As Integer
Dim stre As String
Set xlApp = New Excel.Application
Set wb = xlApp.Workbooks.Open("C:\Documents and Settings\c5098466\My Documents\Guru\Solution Tracker\Notefix Tracker1.xls")
Set ws = wb.Worksheets("Sheet1")
'Give your worksheet name
stre = ""
For i = 1 To 10
For j = 1 To 12
stre = stre & ws.cells(i, j).Value & vbTab
'Print (ws.cells(i, j).Value)
'Do whatever u want here
Next
stre = stre & vbCrLf
Next
wb.Close
Print stre
xlApp.Quit
Set ws = Nothing
Set wb = Nothing
Set xlApp = Nothing
here how can i specify the EOF in the for loops
Dim wb As Workbook
Dim ws As Worksheet
Dim i As Integer
Dim stre As String
Set xlApp = New Excel.Application
Set wb = xlApp.Workbooks.Open("C:\Documents and Settings\c5098466\My Documents\Guru\Solution Tracker\Notefix Tracker1.xls")
Set ws = wb.Worksheets("Sheet1")
'Give your worksheet name
stre = ""
For i = 1 To 10
For j = 1 To 12
stre = stre & ws.cells(i, j).Value & vbTab
'Print (ws.cells(i, j).Value)
'Do whatever u want here
Next
stre = stre & vbCrLf
Next
wb.Close
Print stre
xlApp.Quit
Set ws = Nothing
Set wb = Nothing
Set xlApp = Nothing
here how can i specify the EOF in the for loops
![]() |
Similar Threads
- Excel to Web in Real Time? (ASP)
- How to write files to an Excel application (Visual Basic 4 / 5 / 6)
- grabbing source from excel file (was: please, somebody help me!!!) (Visual Basic 4 / 5 / 6)
- Macros in Excel (Visual Basic 4 / 5 / 6)
- Visual C++ and Excel (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: can we create database through vb in sqlite
- Next Thread: What are the following used for and how do you use them?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





