Solved

Connect to Sharepoint 2010 list with Excel 2010 using vba code?

Posted on 2012-04-13
5
1,652 Views
Last Modified: 2012-04-13
I have come across links to connect to Excel 2003/2007 with Sharepoint 2003/2007 using vba code. Just wondering how is it different in Sharepoint 2010 and Excel 2010.the goal is to export Sharepoint 2010 list to excel 2010. Any idea?

Thanks.
0
Comment
Question by:dearnemo
  • 3
  • 2
5 Comments
 
LVL 31

Expert Comment

by:Jamie McAllister MVP
ID: 37843095
You can export a SharePoint 2010 list to excel pretty easily. There's an option on the SharePoint ribbon to Open in Excel, and you can open from the Excel end too.

What is the VBA code achieving? Could you explain your requirement a little more, and highlight the links you're following?
0
 

Author Comment

by:dearnemo
ID: 37843279
Hi Jamie,

Thanks for your reply. I can do export Sharepoint 2010 list to Excel 2010 using ribbon interface. Basically it generates .iqy file which is an excel file.
There's a need to automate this process using Excel 2010 vba code instead of click-point ribbon interface. So the Vba code would achieve automating the exporting list items to excel 2010.

Here's the link I was following.
http://sharepoint.stackexchange.com/questions/29021/import-sharepoint-list-into-excel-using-vba-only

Looking forward to your answer. Thanks.
0
 
LVL 31

Accepted Solution

by:
Jamie McAllister MVP earned 500 total points
ID: 37843385
There's no invalid or deprecated feature being used in that code that I can see.

I just used it with Excel 2010 and SharePoint 2010 here and it populates the workbook with the list content as it would have for MOSS 2007.

Hope this answers your question.
0
 

Author Comment

by:dearnemo
ID: 37843574
Hi Jamie,

Thanks a lot. I found out my error. I had provided the full address for SERVER, which was contradicting with strSPServer variable.

Thanks again. Your positive answer boosted my confidence in checking my code again and again to find out the error. Thanks again.
0
 

Author Comment

by:dearnemo
ID: 37844215
Hi Jamie,

 I have some questions on vba. In my SharePoint list I already had ID field. The o/p of the vba code inserted another ID field in the Excel file. So now there are two identical ID fields though the one Excel automatically filled in has ID number starting with 1. I don't want the Excel generated ID and only need the ID field in my SharePoint list. How do I achieve that in the vba code ? Since I am new to vba world, I expect some guidance in this forum.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now