ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do i Link SQL data with a Excel Cell. (https://www.excelbanter.com/excel-programming/375902-how-do-i-link-sql-data-excel-cell.html)

Spudanator

How do i Link SQL data with a Excel Cell.
 
Currently I am trying to link my excel spreadsheet with a SQL database. what
i want setup is so that the cell is linked to a specific cell in the database
and is continually updated. is this possible.. if not how do i create a
macros button to allow me to refresh when required. Thankyou for your
assistance.

Tom Ogilvy

How do i Link SQL data with a Excel Cell.
 
perhaps using Data=External Data and create a query in the worksheet using
ODBC. Use an SQL query that returns the single value you want.

The properties of the querytable can be set to control refreshing although I
am not sure about continuously - but periodically as I recall. You probably
want to reject the option to allow a backgroundquery.


--
Regards,
Tom Ogilvy



"Spudanator" wrote in message
...
Currently I am trying to link my excel spreadsheet with a SQL database.
what
i want setup is so that the cell is linked to a specific cell in the
database
and is continually updated. is this possible.. if not how do i create a
macros button to allow me to refresh when required. Thankyou for your
assistance.




jseven

How do i Link SQL data with a Excel Cell.
 
Your best bet is simply to use the "get external data" feature under
the "data" menu item. Record your actiions via the macro tool while
you go through the motions to get your external data.

ONce you've completed it, just edit the code you just recorded to tweak
it for any variables you want etc.

You can update it / refresh it whenever you want or even just set it up
to auto update.

Regards,
Jamie
Spudanator wrote:
Currently I am trying to link my excel spreadsheet with a SQL database. what
i want setup is so that the cell is linked to a specific cell in the database
and is continually updated. is this possible.. if not how do i create a
macros button to allow me to refresh when required. Thankyou for your
assistance.



Spudanator

How do i Link SQL data with a Excel Cell.
 
Sorry for the late reply but i figured out how to do it by importing the
whole table into the document. few questions

Is there a reason why i would want to reject the option to allow for
background query. each time i try and use an SQL query to return a value. all
that seems to do is write the SQL query on the spreadsheet. i have done it a
different way and got the whole table to be output on a seperate worksheet if
its possible to do it another way i would alway like to know just for my own
knowledge. Finally once this is done how can i then send some new data back
to the SQL data base..
"Tom Ogilvy" wrote:

perhaps using Data=External Data and create a query in the worksheet using
ODBC. Use an SQL query that returns the single value you want.

The properties of the querytable can be set to control refreshing although I
am not sure about continuously - but periodically as I recall. You probably
want to reject the option to allow a backgroundquery.


--
Regards,
Tom Ogilvy



"Spudanator" wrote in message
...
Currently I am trying to link my excel spreadsheet with a SQL database.
what
i want setup is so that the cell is linked to a specific cell in the
database
and is continually updated. is this possible.. if not how do i create a
macros button to allow me to refresh when required. Thankyou for your
assistance.






All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com