Formula assignment problem

  • Thread starter Thread starter Michel S.
  • Start date Start date
M

Michel S.

Hello !

I'm generating a spreadsheet from Access. (all in 2002)

At one point, I have the following formula to put into a cell :

xlSheet.Range(...).FormulaR1C1 = _

"IF(ISBLANK(RC[-1]),"""",IF(LEFT(RC[-1],1)=""N"",""Fail"",""Passed""))"

If I do the assignment directly in code as above, it works well. But
if I use instead :

xlSheet.Range(...).FormulaR1C1 = strFormula

where strFormula contains exactly the same formula (except for the
leading and trailing quotes), it fails with an error 1004

Any idea ?

Thanks in advance.
 
Problem solved..

Since the formula is stored in a database field, it doesn't require the
double double quotes to indicate a double quote character.
 

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

Back
Top