VYX Level: Professor Registered: 16-12-2005 Posts: 70
HELP SAVING DATA TO EXISTING AND UNEXISTING FILE OF EXCEL
Hi..
My microsoft excel file have a file name c:\info.xls
Anybody can help me,, my problems are followed:
1. I want to save the data into ms excel: (back up)
2. I want also to replace the data into ms excel
I mean, when i edit the data in running vb application the data stored in ms excel be updated..in short i want to save the data in a formatted rows and columns of existing excel file.
3. i want to read the data stored in excel file and transfert the data in textbox or listview.
any help are greatly appreciated...
thanks in advance
14-01-2006 at 08:37 AM
|
Dave Green Level: Professor Registered: 20-10-2005 Posts: 90
Re: HELP SAVING DATA TO EXISTING AND UNEXISTING FILE OF EXCEL
Hi
All of what you want is possible. You need to make a reference to the MS Excel Object Library 9.0.
In your vb project select Menu>Project>References and from the list that appears, select MS Excel Object Library 9.0.
You now have access to basically everything within the Excel application and by setting a reference to a particular workbook or sheet you have access to all the data contained therein.
To read or write to particular cells you use the Range() object.
The Excel object library is simple yet involved, you may need to learn a little about it, far more than can reasonably be attempted here, although I learnt it myself through trial and error and a tad of common sense. Try the online MSDN or jst have a play.
Hope this helps and good luck
Dave
____________________________
While Breath.Count>0
Live(gbRelax)
Wend
15-01-2006 at 01:45 PM
|
pavane Level: VB Lord Registered: 26-04-2004 Posts: 179
Re: HELP SAVING DATA TO EXISTING AND UNEXISTING FILE OF EXCEL
Just a thought.
If the excel sheet is only a single worksheet in a simple format, you might find it easier to save in a CSV file, which can easily be read by other apps as a text file.