I have an excel sheet which is calculating some value based on some value sent by access. Sometimes in the Excel sheet you can have a #value if there is no result. Now if Excel returns a #value how do i trap it in Access..Any help is appreciated.
First, you might have better luck in the office VBA forum because people there are more likely to use Excel and VBA. Are you automating Excel? If not, you will have to.
Secondly, Why? Surely any calculation you are doing in Excel you can do in Access. The test in Access is likely far simpler. Even so, you may be able to find what data gives you #value (probably a null or zero length string somewhere) and test for it before you send the data to Excel.
Having just looked in Excel help, it looks like the funtion takes three parameters and returns a value.
In Access, you could do two things to avoid dumping to Excel.
Write your own function to do the same as Poisson. In my experience it is better to build a string for any arithmetic expression and use the eval function to evaluate it to lessen any floating point issues.
Alternately, you could set a reference to Excel in a module (tools references). Then you should be able to write your own wrapper function for the Excel function and use it in your query.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.