Solved

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

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...

685 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