Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 18th, 2003, 07:52 PM
one shot one shot is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 4 one shot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Excel input and output from VB

Due to lack of replies from the .Net forum I've decided to try here. I think this can be done using VB6 as well. How do you import 20 sequential cells from Excel 2002 into VB to perform some calculations using Excel functions (IRR, NPV, etc.) then insert the result back into the same worksheet and also to a label in VB?

Reply With Quote
  #2  
Old December 18th, 2003, 10:21 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
It will take a lot of time and your energy!I recommmend u to use vba in excel2002!

Reply With Quote
  #3  
Old December 18th, 2003, 11:14 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,179 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 10 h 3 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
well, you could possibly add a reference to the Excel library and declare a variable of type Excel.Application. that should allow you to input the data into your app as a variable array, and I believe should give you access to the functions you need. Office automation in .NET is a little more difficult... i would recommend VB6 for this one.
__________________
Fisherman

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein

Reply With Quote
  #4  
Old December 20th, 2003, 10:23 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
Yes,U can call vba in excel2002 as my meaning,or make a vb program by refer excel library as what fisherman said!It's your choice!

Reply With Quote
  #5  
Old January 5th, 2004, 06:01 AM
anca anca is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 30 anca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
It's quite easy to do this. I did it in VFP but it's easier in VB. You have to declare an Excel.Application object as Fisherman said and then work with the methods of this object. If you don't know exact what to do, try to execute the same operation in Excel and record it as a Macro. Then look at the VB code of the Macro and you will see.

Reply With Quote
  #6  
Old January 6th, 2004, 06:37 AM
MidWaYz MidWaYz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 49 MidWaYz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 6 m 20 sec
Reputation Power: 5
Thats quite a good idea anca!! Me too, I was trying to do some stuffs with my excel and vb, but lately decided to go with Access and vb LOL.

The thought of excuting the operation in Excel and record it as a Macro never come to cross my mind.

I have to check that.

Hopefully, I like to read postings LOL. Its very useful.

Regards

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Excel input and output from VB


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT