Problem with refresh on formula when running VBA code

acronym

New Member
Joined
Jul 30, 2014
Messages
1
I am having a problem with an Excel model which is crashing when I run my code because a formula is not evaluating properly and is resulting in the value #NA.

I use some code to enter a formula in a series of cells. It uses a couple of vlookups to form a string value that I will use for a http link. When I run my main processing code I get an error at some point in the execution that reads the values in these calls. When I view the worksheet cells were this formula is I see the values #NA. My code is unable to proceed so I kill it. When I do this the cells suddenly display the values I want. This is so annoying and I am stuck.

I have tried copying the formula as values to the cells but this makes no difference.
I have tried to recalculate the worksheet but this made no difference.

I have seen other posts were people complain about the formula not evaluating and just displaying the formula as text but this is not quite that case, and I have not seen any posts like mine before. any advice is greatly appreciated.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,221,418
Messages
6,159,790
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top