Skip to content

Commit d33b970

Browse files
committed
Ribbon: Initial setup
1 parent c99073a commit d33b970

File tree

8 files changed

+234
-0
lines changed

8 files changed

+234
-0
lines changed

Ribbon/Functions.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace Ribbon
2+
{
3+
public static class Functions
4+
{
5+
public static string dnaRibbonTest()
6+
{
7+
return "Hello from the Ribbon Sample!";
8+
}
9+
}
10+
}

Ribbon/Properties/AssemblyInfo.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Ribbon")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Ribbon")]
13+
[assembly: AssemblyCopyright("Copyright © 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("e3006e35-d991-4ba3-98b7-fa65db01c895")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="ExcelDnaProps">
2+
<!--
3+
If you change properties in this file, they may not come into effect until you:
4+
* Rebuild the solution/project
5+
6+
or
7+
8+
* Close Visual Studio
9+
* Delete .vs folder, if exists
10+
* Delete ProjectName.csproj.user (or equivalent for VB, F#, etc.), if exists
11+
* Delete SolutionName.suo, if exists
12+
* Open your solution/project again in Visual Studio
13+
-->
14+
15+
<!--
16+
Configuration properties for building .dna files
17+
-->
18+
<PropertyGroup>
19+
<!--
20+
Enable/Disable automatic generation of platform-specific versions of .dna files
21+
-->
22+
<ExcelDnaCreate32BitAddIn Condition="'$(ExcelDnaCreate32BitAddIn)' == ''">true</ExcelDnaCreate32BitAddIn>
23+
<ExcelDnaCreate64BitAddIn Condition="'$(ExcelDnaCreate64BitAddIn)' == ''">true</ExcelDnaCreate64BitAddIn>
24+
25+
<!--
26+
Define the suffix used for each platform-specific file e.g. MyAddIn64.dna
27+
-->
28+
<ExcelDna32BitAddInSuffix Condition="'$(ExcelDna32BitAddInSuffix)' == ''"></ExcelDna32BitAddInSuffix>
29+
<ExcelDna64BitAddInSuffix Condition="'$(ExcelDna64BitAddInSuffix)' == ''">64</ExcelDna64BitAddInSuffix>
30+
</PropertyGroup>
31+
32+
<!--
33+
Configuration properties for packing .dna files
34+
-->
35+
<PropertyGroup>
36+
<!--
37+
Enable/Disable packing of .dna files
38+
-->
39+
<RunExcelDnaPack Condition="'$(RunExcelDnaPack)' == ''">true</RunExcelDnaPack>
40+
41+
<!--
42+
Suffix used for packed .xll files e.g. MyAddIn-packed.xll
43+
-->
44+
<ExcelDnaPackXllSuffix Condition="'$(ExcelDnaPackXllSuffix)' == ''">-packed</ExcelDnaPackXllSuffix>
45+
</PropertyGroup>
46+
</Project>
47+

Ribbon/Readme.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Ribbon Sample
2+
3+
## Initial setup
4+
5+
1. Create new Class Library project.
6+
2. Install `ExcelDna.AddIn` package.
7+
3. Add a small test function:
8+
9+
```cs
10+
namespace Ribbon
11+
{
12+
public static class Functions
13+
{
14+
public static string dnaRibbonTest()
15+
{
16+
return "Hello from the Ribbon Sample!";
17+
}
18+
}
19+
}
20+
```
21+
22+
4. Press F5 to load in Excel, and then test `=dnaRibbonTest()` in a cell.

Ribbon/Ribbon-AddIn.dna

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<DnaLibrary Name="Ribbon Add-In" RuntimeVersion="v4.0">
2+
<ExternalLibrary Path="Ribbon.dll" ExplicitExports="false" LoadFromBytes="true" Pack="true" />
3+
4+
<!--
5+
The RuntimeVersion attribute above allows two settings:
6+
* RuntimeVersion="v2.0" - for .NET 2.0, 3.0 and 3.5
7+
* RuntimeVersion="v4.0" - for .NET 4 and 4.5
8+
9+
Additional referenced assemblies can be specified by adding 'Reference' tags.
10+
These libraries will not be examined and registered with Excel as add-in libraries,
11+
but will be packed into the -packed.xll file and loaded at runtime as needed.
12+
For example:
13+
14+
<Reference Path="Another.Library.dll" Pack="true" />
15+
16+
Excel-DNA also allows the xml for ribbon UI extensions to be specified in the .dna file.
17+
See the main Excel-DNA site at http://excel-dna.net for downloads of the full distribution.
18+
-->
19+
20+
</DnaLibrary>

Ribbon/Ribbon.csproj

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{E3006E35-D991-4BA3-98B7-FA65DB01C895}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Ribbon</RootNamespace>
11+
<AssemblyName>Ribbon</AssemblyName>
12+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="ExcelDna.Integration, Version=0.34.6275.43070, Culture=neutral, processorArchitecture=MSIL">
34+
<HintPath>packages\ExcelDna.Integration.0.34.4-rc3\lib\ExcelDna.Integration.dll</HintPath>
35+
<Private>False</Private>
36+
</Reference>
37+
<Reference Include="System" />
38+
<Reference Include="System.Core" />
39+
<Reference Include="System.Xml.Linq" />
40+
<Reference Include="System.Data.DataSetExtensions" />
41+
<Reference Include="Microsoft.CSharp" />
42+
<Reference Include="System.Data" />
43+
<Reference Include="System.Xml" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Compile Include="Functions.cs" />
47+
<Compile Include="Properties\AssemblyInfo.cs" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<None Include="Ribbon-AddIn.dna" />
51+
<None Include="packages.config" />
52+
<None Include="Properties\ExcelDna.Build.props" />
53+
</ItemGroup>
54+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
55+
<Import Project="packages\ExcelDna.AddIn.0.34.4-rc3\tools\ExcelDna.AddIn.targets" Condition="Exists('packages\ExcelDna.AddIn.0.34.4-rc3\tools\ExcelDna.AddIn.targets')" />
56+
<Target Name="EnsureExcelDnaTargetsImported" BeforeTargets="BeforeBuild" Condition="'$(ExcelDnaTargetsImported)' == ''">
57+
<Error Condition="!Exists('packages\ExcelDna.AddIn.0.34.4-rc3\tools\ExcelDna.AddIn.targets') And ('$(RunExcelDnaBuild)' != '' And $(RunExcelDnaBuild))" Text="You are trying to build with ExcelDna, but the NuGet targets file that ExcelDna depends on is not available on this computer. This is probably because the ExcelDna package has not been committed to source control, or NuGet Package Restore is not enabled. Please enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
58+
<Error Condition="Exists('packages\ExcelDna.AddIn.0.34.4-rc3\tools\ExcelDna.AddIn.targets') And ('$(RunExcelDnaBuild)' != '' And $(RunExcelDnaBuild))" Text="ExcelDna cannot be run because NuGet packages were restored prior to the build running, and the targets file was unavailable when the build started. Please build the project again to include these packages in the build. You may also need to make sure that your build server does not delete packages prior to each build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
59+
</Target>
60+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
61+
Other similar extension points exist, see Microsoft.Common.targets.
62+
<Target Name="BeforeBuild">
63+
</Target>
64+
<Target Name="AfterBuild">
65+
</Target>
66+
-->
67+
</Project>

Ribbon/Ribbon.sln

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ribbon", "Ribbon.csproj", "{E3006E35-D991-4BA3-98B7-FA65DB01C895}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E0EFA236-6923-49D5-991E-E1FC811C5DE0}"
9+
ProjectSection(SolutionItems) = preProject
10+
Readme.md = Readme.md
11+
EndProjectSection
12+
EndProject
13+
Global
14+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
15+
Debug|Any CPU = Debug|Any CPU
16+
Release|Any CPU = Release|Any CPU
17+
EndGlobalSection
18+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19+
{E3006E35-D991-4BA3-98B7-FA65DB01C895}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{E3006E35-D991-4BA3-98B7-FA65DB01C895}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{E3006E35-D991-4BA3-98B7-FA65DB01C895}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{E3006E35-D991-4BA3-98B7-FA65DB01C895}.Release|Any CPU.Build.0 = Release|Any CPU
23+
EndGlobalSection
24+
GlobalSection(SolutionProperties) = preSolution
25+
HideSolutionNode = FALSE
26+
EndGlobalSection
27+
EndGlobal

Ribbon/packages.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="ExcelDna.AddIn" version="0.34.4-rc3" targetFramework="net40" />
4+
<package id="ExcelDna.Integration" version="0.34.4-rc3" targetFramework="net40" />
5+
</packages>

0 commit comments

Comments
 (0)