Excel formula not activating??? -- Pls. help

M

mohanamr

I am trying to export data from MS Access to MS Excel and then do some
caluclations. After exporting I open the excel object using MS Access
VBA and write inbuilt formula in a cell in the excel. When I open the
exported excel I could see the formula written in the excel cell, but I
could not see the calculated value in the cell. I could see some thing
like "#NAME?".

Later if I press "F2" on the cell and then press "enter" the formula
gets effect and the value gets displayed.

Can this be solved by VBA code?? When I open the exported excel sheet I
should be able to see the calucated values instead of the formula
alone.

Can anyone help me out in this.. Please treat this as very urgent!!!

The below line shows the line of code (formula) I used in MS Access VBA
to populate the cells:

..Worksheets(1).Range("B4", "B10").Formula = "=IF(P4=" & Chr(34) & "AD"
& Chr(34) & ",EDATE($D4,$F4-1),EDATE($D4,$F4))"


With Expectations,
Mohana
:confused:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top