Once you have created a workbook or Excel customization, you might want to use it on other machines, possibly without FCell installed.

Let's have a look how this can be done.

Workbook customization deployment

You can create a workbook customization in 3 ways:

  • Compile source in FCell built-in code editors with Build in FCell Ribbon

  • Embed external customization assemblies via Doc .NET AddIn in FCell Ribbon

  • Create custom IWorkbookAssemblyFeed MEF extension (Enterprise Edition only) and embed it in the workbook via Doc .NET AddIn. See Chapter MEF Extensions : Assembly Feed

In each case a self contained macro enabled workbook is created. FCell runtime and customization assemblies are embedded in the workbook and you can open and run the workbook on machines with or without FCell.

If your customization assemblies rely on other assemblies not found in GAC on target machine then you can embed the referenced assemblies in your workbook via Doc .NET AdIn->References or implement a custom MEF IWorkbookAssemblyFeed extension.

When you create a new FCell enabled workbook via New Doc you specify which runtime to embed in the workbook: 32bit, 64bit or both. Each FCell runtime is ca 1.5MB. Choose the right runtime for the target machine or embed both.

Note

Workbooks with FCell embedded FCell customization are digitally signed with StatFactory Publisher certificate. You can add StatFactory to trusted publishers in Excel if your local Excel policy requires digitally signed macro workbooks.

Workbooks with FCell customization are automatically protected by FCell licensing system. If runtime license key is not found in the workbook, the customization will work as a trial for 30 days only.

You can embed a runtime license key in your workbook via Doc .NET AddIn form.

Workbook Customization With Data

Excel customization deployment

You can create an Excel customization in 3 ways:

  • Add existing customization assemblies via Excel .NET AddIn

  • Package existing customization assemblies into a single XLL file.

  • Create custom IExcelAssemblyFeed MEF extension (Enterprise Edition only) and save it in %FCell folder%/Extensions or embed it in XLL file. See Chapter MEF Extensions : Assembly Feed

In the first case, the customization is specified by current user, persisted in user config file and requires FCell developer license.

The packaged customization can be activated on any machine, even without FCell and requires only a runtime license.

You can package Excel customization using methods from FCell.ManagedXll.XllPackager class (F# module):

  • Make a copy of FCell32bit_2_5_0.xll or FCell64bit_2_5_0.xll, located in your FCell folder, and rename it to e.g. MyCustomization.xll

  • Run in FCell F# code editor or Visual Studio F# interactive:

    F# Copy imageCopy
    open FCell.ManagedXll
    XllPackager.AddCustomizationAssemblies "path to MyCustomization.xll" [|"path to assembly1";"path to assembly2"|] //...

    If your customization assemblies rely on other assemblies not found in GAC on target machine then you can also package them:

    F# Copy imageCopy
    open FCell.ManagedXll
    XllPackager.AddReferencedAssemblies "path to MyCustomization.xll" [|"path to ref assembly1";"path to ref assembly2"|] //...

    You can also define customization and reference assembly feed in AssemblyFeed MEF extensions and package them in XLL file:

    F# Copy imageCopy
    open FCell.ManagedXll
    XllPackager.AddExtensionAssemblies "path to MyCustomization.xll" [|"path to extension assembly1";"path to extension assembly2"|] //...

    Alternatively, you can distribute the referenced assemblies with your xll file

  • Optionally embed FCell runtime key

    Packaged Excel customizations are automatically protected by FCell licensing system. If runtime license key is not found in the xll file, the customization will work as a trial for 30 days only on machines without FCell installed.

    Run this code to embed a runtime key in the xll file:

    F# Copy imageCopy
    open FCell.ManagedXll
    XllPackager.AddRuntimeKey "path to MyCustomization.xll" "your runtime key"
  • Make sure C++ Runtime 2012 is installed on the target machine or distribute msvcr110.dll with your packaged XLL file.

Packaged customization can be activated on target machine just like any other XLL AddIn.