Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an Excel file that is already designed and formulas created .

I want to get data from my SQL server database and show the data in my excel file and run the formulas already exists in my excel.

How to connect my excel to the database and place them in predefined place of the data and formulas?
Posted
Comments
Kumarbs 22-Jul-14 7:54am    
Are you asking about MySql or Sql Server?
TheWebDeveloper 22-Jul-14 8:30am    
sql server

The simplest way is to use Excel tools. Have a look here: Connect to (import) SQL Server data[^]

You can always use ADODB + VBA: How To Use ADO with Excel Data from Visual Basic or VBA[^] together with CopyFromRecordset[^] method.
 
Share this answer
 
Comments
TheWebDeveloper 22-Jul-14 8:31am    
Can I call stored procedures from excel and display records in excel?
Maciej Los 22-Jul-14 8:34am    
Yes, by using ADODB.Command. Folow the second link.
TheWebDeveloper 23-Jul-14 4:42am    
do you mean using vb.net?
Maciej Los 23-Jul-14 4:52am    
No, VBA.
You may use Data Connection Wizard[^] of the free SaveToDB Express add-in.

In addition to standard Excel features, it allows:

- connecting to stored procedures;
- specifing WHERE filters for tables and views in a visual mode.

Also you can save data changes back to a database.
 
Share this answer
 
Comments
TheWebDeveloper 24-Jul-14 2:20am    
I will try it. And this is real time? whenever I open the excel it will get me the data real time?
Sergey Vaselenko 24-Jul-14 4:00am    
SaveToDB loads all the data into Excel table at once.
But you may configure the AutoRefresh property of the Excel query to update the data periodically.

RealTimeToExcel allows updating data in real time and not only in regular tables.
But you should configure real time formulas like
=RTD("gartle.rtd",,"sql-express","table name","index key value","result data field name")

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900