DynamicAccounting.netYou, Me, and Dynamics GP

2013-04-08 · 2013

Weekly Dynamic: Stored Procedures in Excel

SQL & DataTips & Hidden FeaturesExcel & Office

Archived post from 2013. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.

I ran into an Excel bug recently. To run a stored procedure in Excel one option is to:

  • Connect to GP via ODBC and MS Query
  • Connect to a table and return data
  • Send the data to Excel
  • Change the SQL, add the stored proc, with Execute StoredProc ?,?
  • Excel will pick up the parameters. Point them to cells.

The problem is that after you save and reopen the file, it can crash Excel. This doesn’t happen all the time but I had it happen consistently in Excel 2010.

The answer is to add it differently:

  • Connect to GP via ODBC and MS Query
  • Connect to a table and return data
  • Change the SQL in MS Query. use {Call StoredProc (?,?)}
  • Key in placeholder amounts for the parameters
  • Send the data to Excel
  • Point the parameters to cells.

There is a lot more detail here: http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/d86fbdfa-82e2-4da7-92df-ae5f0f60090b 

 

Original article: https://social.msdn.microsoft.com:443/Forums/error/notfound