#NAME error from Excel sheet created by VB form program

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I tried posting this on the Excel Developers website, but havent gotten any good answers, and I think it might be a VB.NET developer issue, so am posting it here.

I have created a VB.NET program that creates and opens an Excel spreadsheet, which loads fine. The program adds the wording for a user-defined function called "Light()". The Light() function is an add-in I had previously created with VBA for a user-defined function, which takes parameters and gets data from a database. The VB program populates a range of cells with the Light() function, loaded with various values for the parameters, then retrieves values from a database. It works fine here. The created Excel sheet pops open with the values from the Light() function showing.
The problem comes when I try to copy and paste the functions from the newly created spreadsheet (A) to another Excel spreadsheet (B) that is also loaded with the Light() add-in. The Light() function works fine in both spreadsheets, but when I copy a parameterized Light() function from spreadsheet A to spreadsheet B, the #NAME error appears. When I refresh the cell (by putting my cursor at the end of the edit line and pressing enter), the error disappears and the value appears). The function and parameters look exactly right, both before I refresh and after.
As a test, I opened an older spreadsheet (C) that has Light() functions, and I am able to cut and paste from spreadsheet C to spreadsheet A just fine. The values show up without having to refresh. No error.

Any thoughts on why this is occurring or how to prevent it?
Gina

View the full article
 
Back
Top