Microsoft KB Archive/930006

= A SharePoint list is converted to a table, and synchronization of the SharePoint list is disabled after you save an Excel 2007 workbook =

Article ID: 930006

Article Last Modified on 5/14/2007

-

APPLIES TO


 * Microsoft Office Excel 2007
 * Microsoft Windows SharePoint Services

-



SYMPTOMS
When you save a Microsoft Excel workbook in a Microsoft Office Excel 2007 format to a Windows SharePoint Services 3.0 linked list, the SharePoint list is converted to a table. Additionally, synchronization of the SharePoint list is disabled.

Note Existing Microsoft Office Excel 2003 workbooks can still be synchronized in a SharePoint linked list.



CAUSE
This behavior is by design. This behavior occurs because Excel 2007 does not support synchronization of SharePoint lists that write back to the SharePoint site. Excel 2003 supports synchronization of SharePoint lists that write back to the SharePoint site.



WORKAROUND
To work around this behavior, run a Microsoft Visual Basic for Applications (VBA) macro to create a new SharePoint linked list that supports synchronization. To do this, follow these steps.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.  On the SharePoint site, locate the linked list.

Note Note the list name in SharePoint. Export the linked list to an Excel 2007 table. To do this, follow these steps:  Under Actions on the page that displays the list, click Export to Spreadsheet. Save the .iqy file to the desktop.  Open the .iqy file in Excel 2007. If you are prompted to enable data connections on your computer, click Enable.

Note Click Enable only if you believe that the connection to the data on the SharePoint site is safe to enable.</li> In the Import Data dialog box, click Table under Select how you want to view this data in your workbook, click New worksheet under Where do you want to put the data, and then click OK.</li> On the Data tab, click Connections in the Connections group.</li> In the Workbook Connections dialog box, click the connection to the SharePoint list, and then click Properties.</li> In the Connection Properties dialog box, click the Definition tab, and then copy the GUID and the URL to a text editor.

Note You will use the GUID and the URL in step 12.</li> Click OK, and then click Close.</li> Press ALT+F11 to start the Visual Basic Editor.</li> On the Insert menu, click Module.</li>  In the module sheet, create a VBA macro that resembles the following VBA macro. In this macro, &quot;GUIDString&quot; is the GUID and &quot;URL String&quot; is the URL that you copied to the text editor in step 8. Additionally, &quot;ListNameString&quot; is the name of the list on the SharePoint site. Sub LinkedSharePointList

ActiveSheet.ListObjects.Add SourceType:=xlSrcExternal, _ Source:=Array(<&quot;URL String&quot;>, <&quot;ListNameString&quot;>, _    <&quot;{GUIDString}&quot;>), LinkSource:=True, Destination:=Range(&quot;A1&quot;)

End Sub The following code sample is a correctly written macro for this example. Sub LinkedSharePointList

ActiveSheet.ListObjects.Add SourceType:=xlSrcExternal, _ Source:=Array(&quot;http://myserver/_vti_bin&quot;, &quot;MyList&quot;, _    &quot;{D607DDB3-710F-433C-B6E6-3878E041D669}&quot;), LinkSource:=True, Destination:=Range(&quot;A1&quot;)

End Sub Note You cannot use the HasHeaders argument for the ListObjects.Add method. If you do this, you will receive the following error message:

Named argument not found.

</li> Save the file in the Excel 97-2003 Workbook (*.xls) format. To do this, follow these steps:  In the Visual Basic Editor, click Close and Return to Microsoft Excel on the File menu.</li> Click the Microsoft Office Button, and then click Save As.</li> In the Save as type box, click Excel 97-2003 Workbook (*.xls), and then save the file to the SharePoint list.</li></ol> </li> Delete the table that contains the list.

Note You cannot link the list to SharePoint if you do not delete the table that you created from the .iqy file.</li> On the Developer tab, click Macros.</li> <li>In the Macro dialog box, click LinkedSharePointList, and then click Run.

Note when the list has been created, save and close the workbook.</li> <li>To write changes to the list to SharePoint, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>In Excel 2007, open the .xls file that you saved in step 13.</li> <li>Modify the workbook.</li> <li>Right-click in the list.</li> <li>Click Table.</li> <li>Click Synchronize with SharePoint.</li> <li>Save the .xls file to keep the changes.</li></ol> </li> <li>To pull changes that are made to the linked list in SharePoint by other users, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Right-click in the list.</li> <li>Click Table.</li> <li>Click Synchronize with SharePoint.</li> <li>Save the .xls file to keep the changes.</li></ol> </li></ol>

Additional query words: excel2007 excel2k7 excel12 xl2007 xl2k7 xl12 wssv3 sharepoint

Keywords: kbhowto kbvba kbmacro kbautomation kbprogramming kbsavefile kberrmsg kbtshoot kbexpertiseinter kbprb KB930006

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.