[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

write SQL Server 2 Excel

Posted on 2012-04-07
5
Medium Priority
?
314 Views
Last Modified: 2012-04-27
I know there must be a way to write to  cells within excel from sql Server.  This is possible to do in access.

I need VBA code (Function) that will write a stored procedure results to a user defined location on a excel workbook.

Lets say the SP returns 6 records (each records contains five fields).  I want to dump the results to cell "A1" or any other location in the workbook.

                  Cell A1   Cell B1    Cell C1       Cell D1    Cell E1
  record 1  FName   LName     Address     city          State
  record 2  FName   LName     Address     city          State
.
.
.
  record 6  FName   LName     Address     city          State
0
Comment
Question by:tru-numbers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 35

Expert Comment

by:Norie
ID: 37819197
So you need to do it in Access?

You could do this using VBA and ADO in Excel.

If you do need it in Access you could set up a pass through query to return the results, then export the results to Excel.
0
 

Author Comment

by:tru-numbers
ID: 37819705
Yes that is a possibility, but the user database is in SQL Server 2005.  The DB has 1000 users worldwide.
0
 
LVL 35

Expert Comment

by:Norie
ID: 37819724
Which is a possibility?

The pass through query in Access or pulling directly from SQL Server using VBA in Excel?
0
 

Author Comment

by:tru-numbers
ID: 37820136
I must pull diectly from sql server!
0
 
LVL 35

Accepted Solution

by:
Norie earned 1500 total points
ID: 37820285
You can use VBA with ADO for that.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question