•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 391,555 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,639 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 1663 | Replies: 0
![]() |
•
•
Join Date: Feb 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi All,
I have a problem to solve.I am importing 200000 records(.txt) in notepad into excel but when it gets to 65000 records it truncates telling me that not completely exported.I now write a code in vb editor(excel) trying to count every 5records and export to excel.Please, have a look at this code and correct.Thanks.
rgds
jimi
I have a problem to solve.I am importing 200000 records(.txt) in notepad into excel but when it gets to 65000 records it truncates telling me that not completely exported.I now write a code in vb editor(excel) trying to count every 5records and export to excel.Please, have a look at this code and correct.Thanks.
rgds
jimi
Public NumberOfRecords As Integer
Dim data(i, 2) As String
Dim g, fileName As String
Dim i, numlines, lines, As Integer
Dim line_Name(i), short_Point(i), x(i), y(i), s(i) As Double
Private Sub OpenFileBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenFileBtn.Click
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then 'opens file of users choice if cancel not pressed
FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
lines = getNumLines(1)
FileClose (1)
FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
ReDim data(lines, 2)
For i = 0 To i = lines - 1
Input(1, data(i, 0))
Input(1, data(i, 1))
Input(1, data(i, 2))
line_Name(i) = Val(data(i, 0))
short_Point(i) = Val(data(i, 1))
x(i) = Val(data(i, 2))
y(i) = Val(data(i, 3))
s(i) = Val(data(i, 4))
Next i
FileClose (1)
End If
End Sub
Public Function getNumLines(ByVal fileName As Integer) As Integer
Dim numlines As Integer
numlines = 0
While Not (EOF(1))
numlines = numlines + 5 'counts number of rows in the file
Input(5, g)
End While
Return numLines 'return the number of lines found
End Function
End Class Last edited by Comatose : Mar 9th, 2007 at 3:34 pm.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Similar Threads
- Hoping for Help - Import File into Excel (Visual Basic 4 / 5 / 6)
- Error message while importing data to Excel from the MySQL db (MySQL)
- Exporting Data from App To Excel c# (C#)
- MS Excel data to ASP form (ASP)
- Import info from excel to access (MS Access and FileMaker Pro)
- How to export excel data to a search engine? (MS Access and FileMaker Pro)
- How do import a worksheet to HTML? (HTML and CSS)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: ADODB Y DAO together ?
- Next Thread: Is This Project Possible?


Linear Mode