| | |
Open Excel file from Visual Basic
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Mar 2006
Posts: 5
Reputation:
Solved Threads: 1
I don't know VB6 but I do have Excel.
In .net I get xlApp.Rows.Count = 65536 (i.e. it doesn't recognise where you've stopped inputting values) . If you get this too, this is your subcript out of range problem, and an unhandled error will stop your cleanup code from running, which is why you still have exes running.
You need a do .. until loop (or similar) and check for an empty cell.
You also need to handle runtime errors and put the set xlApp = nothing etc in this section.
I don't know vb6, so I won't embarass myself by trying to write any code.
Sorry I can't be more helpful but hopefully this helps with the array problem.
In .net I get xlApp.Rows.Count = 65536 (i.e. it doesn't recognise where you've stopped inputting values) . If you get this too, this is your subcript out of range problem, and an unhandled error will stop your cleanup code from running, which is why you still have exes running.
You need a do .. until loop (or similar) and check for an empty cell.
You also need to handle runtime errors and put the set xlApp = nothing etc in this section.
I don't know vb6, so I won't embarass myself by trying to write any code.
Sorry I can't be more helpful but hopefully this helps with the array problem.
•
•
Join Date: Mar 2006
Posts: 6
Reputation:
Solved Threads: 1
•
•
•
•
Originally Posted by seagull
I don't know VB6 but I do have Excel.
In .net I get xlApp.Rows.Count = 65536 (i.e. it doesn't recognise where you've stopped inputting values) . If you get this too, this is your subcript out of range problem, and an unhandled error will stop your cleanup code from running, which is why you still have exes running.
You need a do .. until loop (or similar) and check for an empty cell.
You also need to handle runtime errors and put the set xlApp = nothing etc in this section.
I don't know vb6, so I won't embarass myself by trying to write any code.
Sorry I can't be more helpful but hopefully this helps with the array problem.
I removed xlApp.Rows.Count , I replaced it with an integer number
now my program is working and Excel.EXE is not remaining in task manager any more.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
For i = 0 To 200 If xlSht.Cells(j, 1).value = "" Then Exit For Ucode2(i, 0) = xlSht.Cells(j, 1).value Ucode2(i, 1) = xlSht.Cells(j, 2).value j = j + 1 Next
Thanks a lot for those who helped me
![]() |
Similar Threads
- opening excel file in visual basic 6 (Visual Basic 4 / 5 / 6)
- getting data from a text file and putting it in an excel file using visual basic 6.0 (Visual Basic 4 / 5 / 6)
- open a PDF file in visual basic (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: SPI data transfer to Atmega8 by VB6 through parallel port
- Next Thread: winsock question
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column 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 retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






