User Name Password Register
DaniWeb IT Discussion Community
All
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 456,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 3,473 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: Programming Forums
Views: 156305 | Replies: 23 | Solved
Reply
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 108
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: Open Excel file from Visual Basic

  #21  
Apr 3rd, 2006
Oops, I don't have excel installed....

I thought it was part of the vb project files, I'll check it out
Reply With Quote  
Join Date: Mar 2006
Posts: 5
Reputation: seagull is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
seagull seagull is offline Offline
Newbie Poster

Re: Open Excel file from Visual Basic

  #22  
Apr 3rd, 2006
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.
Reply With Quote  
Join Date: Mar 2006
Posts: 6
Reputation: harry.net is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
harry.net harry.net is offline Offline
Newbie Poster

Re: Open Excel file from Visual Basic

  #23  
Apr 4th, 2006
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.

Thanks a lot it helped me too much.
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.


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
Reply With Quote  
Join Date: Feb 2007
Posts: 27
Reputation: mjwest10 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 3
mjwest10 mjwest10 is offline Offline
Light Poster

Re: Open Excel file from Visual Basic

  #24  
Apr 3rd, 2007
This was very helpful
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 5 (0 members and 5 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 5:32 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC