17. december 2012 - 12:39Der er
6 kommentarer og 1 løsning
Data From Access to Excel- undefined function error
Hi,
I use VBA in Access to write custom functions used in queries. Subsequently I need to run the query from excel but I get an undefined function error. I use ODBC to import the data to excel- help anyone? Christian
Thanks. I think your idea works since I tried to put the data in a table and then it worked. The only thing is that I would like to permit the user to update the data from excel. Two questions: 1. Do I also get the undefined function error if I write VBA/adodb code? 2. Would I be able to create a query that updates a given table with the result of my query every time its executed (I mean it would have to delete the old stuff and replace with query data)? Thanks, Christian
I dont work with Excel so often I cant be 100% in my answers on Excel
1. Are you suggesting that you make the same functions in Excel? You could try but I dont think it will work. 2. You said "I think your idea works since I tried to put the data in a table and then it worked". Did you execute the query from Excel? If that is the case then YES. You would also be able to run a delete query in the same way.
It is possible to automate Access from Excel using VBA code, this woukld allow you to run any queries, also those containing user defiend functions. So you could run a query to empty the tabel and then the query to insert the result set from your select query.
Terry, Sorry about not answering. Since you solved my problem I never logged in after closing the issue. Here is a summary of the solution you suggested. 1. Write all the queries with custom functions in access that you need. 2. Create a table in the access database and put your data here after having run your queries with custom functions. 3. Run all your queries in in a procedure from Excel 4. Query your table from excel.
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.