Solved

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

Posted on 2012-04-13
5
1,677 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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