Question Getting the cell below the current one (excel)

BloodyD

New member
Joined
Sep 9, 2010
Messages
1
Programming Experience
1-3
Hey,
I currently got an assignment (well more like a request from my dad, but it's for company use so.)
He asked if I could make a program that retreives certain values from (different) sheets in one workbook, and export it to another one, eventually automaticly creating a graph with the data.

Now, I just started, was a while, worked in VB6 on school, but now trying to do it in VB.net .
I do the excel handling trough
VB.NET:
Imports Excel = Microsoft.Office.Interop.Excel
, so no OleDb stuff, which I'm not known with.

I'm currently trying to make a user selection to specify if the value that should be looked for is right from, or below the cell that contains the f.e. 'Total numbers' field.
I first search for the 'Total numbers' using a .Cell.Find() function, and am wondering how to specify it.


Is there a way to do this ?
VB.NET:
xlWorksheet.ActiveCell.Offset(0, 1).Select
doesn't work, throws :
VB.NET:
Public member 'ActiveCell' on type 'Worksheet' not found.

And can I open an existing file, and create a new excel file at the same time ?
I mean reading the data out, and directly pasting it in the new file?

And, temporary last, but certainly not least, VERY important actually, is how to open a sheet within a workbook without knowing the name.
I tried :
VB.NET:
 xlWorkSheet = xlWorkBook.Worksheets(0)
but sadly it doesn't work, throws :
VB.NET:
Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
Any other options ?

If anything is unclear, please ask.
If I posted in the wrong section, sorry but I couldn't really figure out what should be where so I tought this is the most corresponding one.

Regards

Daneo
 
Last edited:
Back
Top