Add the URL of a form as a link to an Excel workbook from within InfoPath

In this InfoPath demo video you will see how you can use Excel Services to add a link to an existing InfoPath form to an Excel workbook from within the InfoPath form itself.

In recipe 30, you'll learn how to use Excel Services to add a link for an existing InfoPath form to an Excel workbook that is stored in a SharePoint document library.

Get more solutions from InfoPath 2010 Cookbook 5 which is available on Amazon.com
OR
Watch next video: Add a new row to an Excel table from within InfoPath

InfoPath demo video transcript:

Here I'm in SharePoint 2010 where I've got this XLWorkbooksLib document library that contains three empty Excel workbooks. If I open Workbook1 you'll see that there is nothing on Sheet1, nothing on Sheet2, and nothing on Sheet3. The same goes for Workbook2: Nothing on Sheet1, nothing on Sheet2, and nothing on Sheet3. And Workbook3 is the same thing.

The idea is that I would like to add a link to an existing InfoPath form to any one of these three workbooks, and if I add the link to Workbook1 I want the link to be stored in cell A1 on Sheet1. For Workbook2 that would be cell B2 on Sheet2. And for Workbook3 that would be cell C3 on Sheet3.

I've already published an InfoPath form template to this SharePoint form library. So if I click Add document to add a new form, you'll see that as soon as the InfoPath form opens, it will display two controls here. But both controls are disabled, because this is a new form.

So first I'll have to save this form back to the form library to make it an existing form so that it has an URL. And then if I reopen the form you'll see that the controls are now enabled and I can select one of the three workbooks from the XLWorkbooksLib document library from this drop-down list box.

So I'll go ahead and select Workbook2. And as you can remember, for Workbook2, the link to this form should be stored in cell B2 of Sheet2. So I'll click Add Form Link and then I'll save this form again and close it.

And then I'll go back to the XLWorkbooksLib document library and open Workbook2. And then I'll refresh data just in case. And then you'll see that we are here on Sheet2 and the link has appeared in cell B2 of Sheet2. And then if I click on this link, you'll see that it will open the existing InfoPath form, form01.

I can repeat the process and do it for a different form. In this case I'll add the link for form02 to Workbook1. For Workbook1 the link should be stored in cell A1 on Sheet1. So I'll click Add Form Link, save the form, and then close it.

And then again I'll go back to the XLWorkbooksLib document library, open Workbook1, and as you can see, we are on Sheet1, there is nothing on Sheet2 and nothing on Sheet3. And on Sheet1 in cell A1, we've got the link to form02.

Related InfoPath Demo Videos:

Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.

 
InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services