C
Carlos Magalhaes
Hey All,
I am doing some excel automation using the excel COM. I can do most of
the functions and its working well until I come across a formula.
I can run a formula and insert the formula value into a cell. BUT this
is where it comes "complex".
I am retrieving formulas as strings from a database; I then want to
run the formula against a specific spreadsheet and return the value to
my app.
What I am currently seeing is that I have to run a formula set the
value to a cell on the spread sheet then call that value back to the
app. Is there no way of just running the formula against the
spreadsheet and returning the value?
I would appreciate the answer, I have searched high and low but all
the example only show how to run a formula and set the value to a cell
then read the value. i.e.
ObjExcel.WorkSheet.Cell(1,1).formula = StrFormula
Dim srtvalue as string = ObjExcel.WorkSheet.Cell(1,1).Value
But that forces a write into the spread sheet and when you close it,
it asks to save etc, I simply just want to run the formula to return
the outcome of the formula.
I know you can choose to save the file but I would like to know if
there is a way around having to apply the formula to a cell or range
then reading it back from that cell or range. Just appy formula to
data in the Workbook and return the value.
Thank you All
Carlos
I am doing some excel automation using the excel COM. I can do most of
the functions and its working well until I come across a formula.
I can run a formula and insert the formula value into a cell. BUT this
is where it comes "complex".
I am retrieving formulas as strings from a database; I then want to
run the formula against a specific spreadsheet and return the value to
my app.
What I am currently seeing is that I have to run a formula set the
value to a cell on the spread sheet then call that value back to the
app. Is there no way of just running the formula against the
spreadsheet and returning the value?
I would appreciate the answer, I have searched high and low but all
the example only show how to run a formula and set the value to a cell
then read the value. i.e.
ObjExcel.WorkSheet.Cell(1,1).formula = StrFormula
Dim srtvalue as string = ObjExcel.WorkSheet.Cell(1,1).Value
But that forces a write into the spread sheet and when you close it,
it asks to save etc, I simply just want to run the formula to return
the outcome of the formula.
I know you can choose to save the file but I would like to know if
there is a way around having to apply the formula to a cell or range
then reading it back from that cell or range. Just appy formula to
data in the Workbook and return the value.
Thank you All
Carlos