|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
|||
|
|||
|
It will take a lot of time and your energy!I recommmend u to use vba in excel2002!
|
|
#3
|
||||
|
||||
|
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 |
|
#4
|
|||
|
|||
|
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!
|
|
#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.
|
|
#6
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Excel input and output from VB |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|