Skip to content

Commit 84a7a51

Browse files
author
sagi
committed
Update to SDK-style
1 parent 0e9e8a5 commit 84a7a51

11 files changed

+286
-246
lines changed

Fundamentals/RibbonBasics/My Project/AssemblyInfo.vb

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Imports System.Runtime.InteropServices
88

99
' Review the values of the assembly attributes
1010

11-
<Assembly: AssemblyTitle("RibbonBasics")>
11+
'<Assembly: AssemblyTitle("RibbonBasics")>
1212
<Assembly: AssemblyDescription("")>
13-
<Assembly: AssemblyCompany("")>
14-
<Assembly: AssemblyProduct("RibbonBasics")>
13+
'<Assembly: AssemblyCompany("")>
14+
'<Assembly: AssemblyProduct("RibbonBasics")>
1515
<Assembly: AssemblyCopyright("Copyright © 2020")>
1616
<Assembly: AssemblyTrademark("")>
1717

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
3131
' by using the '*' as shown below:
3232
' <Assembly: AssemblyVersion("1.0.*")>
3333

34-
<Assembly: AssemblyVersion("1.0.0.0")>
35-
<Assembly: AssemblyFileVersion("1.0.0.0")>
34+
'<Assembly: AssemblyVersion("1.0.0.0")>
35+
'<Assembly: AssemblyFileVersion("1.0.0.0")>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"profiles": {
3+
"Excel": {
4+
"commandName": "Executable",
5+
"executablePath": "C:\\Program Files\\Microsoft Office\\root\\Office16\\EXCEL.EXE",
6+
"commandLineArgs": "/x \"RibbonBasics-AddIn64.xll\""
7+
}
8+
}
9+
}

Fundamentals/RibbonBasics/Properties/ExcelDna.Build.props

-77
This file was deleted.

Fundamentals/RibbonBasics/Ribbon.vb

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,26 @@
22
Imports Microsoft.Office.Interop.Excel
33
Imports ExcelDna.Integration.CustomUI
44
Imports ExcelDna.Integration
5+
Imports RibbonBasics.My.Resources
56

67
<ComVisible(True)>
78
Public Class Ribbon
89
Inherits ExcelRibbon
910

11+
Public Overrides Function GetCustomUI(RibbonID As String) As String
12+
Return RibbonResources.Ribbon ' The name here is the resource name that the ribbon xml has in the RibbonResources resource file
13+
End Function
14+
15+
Public Overrides Function LoadImage(imageId As String) As Object
16+
' This will return the image resource with the name specified in the image='xxxx' tag
17+
Return RibbonResources.ResourceManager.GetObject(imageId)
18+
End Function
1019
Public Sub OnSayHelloPressed(control As IRibbonControl)
1120
Dim app As Application
1221
Dim rng As Range
1322

1423
app = ExcelDnaUtil.Application
1524
rng = app.Range("A1")
16-
1725
rng.Value = "Hello from .NET!"
1826

1927
End Sub

Fundamentals/RibbonBasics/RibbonBasics-AddIn.dna

-21
This file was deleted.
+27-136
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,28 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" 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>{BC64C7ED-B1ED-4FF3-B286-041CC9D400FE}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<RootNamespace>RibbonBasics</RootNamespace>
10-
<AssemblyName>RibbonBasics</AssemblyName>
11-
<FileAlignment>512</FileAlignment>
12-
<MyType>Windows</MyType>
13-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
14-
<Deterministic>true</Deterministic>
15-
<NuGetPackageImportStamp>
16-
</NuGetPackageImportStamp>
17-
</PropertyGroup>
18-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19-
<DebugSymbols>true</DebugSymbols>
20-
<DebugType>full</DebugType>
21-
<DefineDebug>true</DefineDebug>
22-
<DefineTrace>true</DefineTrace>
23-
<OutputPath>bin\Debug\</OutputPath>
24-
<DocumentationFile>RibbonBasics.xml</DocumentationFile>
25-
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
26-
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<DebugType>pdbonly</DebugType>
29-
<DefineDebug>false</DefineDebug>
30-
<DefineTrace>true</DefineTrace>
31-
<Optimize>true</Optimize>
32-
<OutputPath>bin\Release\</OutputPath>
33-
<DocumentationFile>RibbonBasics.xml</DocumentationFile>
34-
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
35-
</PropertyGroup>
36-
<PropertyGroup>
37-
<OptionExplicit>On</OptionExplicit>
38-
</PropertyGroup>
39-
<PropertyGroup>
40-
<OptionCompare>Binary</OptionCompare>
41-
</PropertyGroup>
42-
<PropertyGroup>
43-
<OptionStrict>Off</OptionStrict>
44-
</PropertyGroup>
45-
<PropertyGroup>
46-
<OptionInfer>On</OptionInfer>
47-
</PropertyGroup>
48-
<ItemGroup>
49-
<Reference Include="ExcelDna.Integration, Version=1.1.0.0, Culture=neutral, PublicKeyToken=f225e9659857edbe, processorArchitecture=MSIL">
50-
<HintPath>packages\ExcelDna.Integration.1.1.0\lib\ExcelDna.Integration.dll</HintPath>
51-
</Reference>
52-
<Reference Include="Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
53-
<HintPath>packages\ExcelDna.Interop.14.0.1\lib\Microsoft.Office.Interop.Excel.dll</HintPath>
54-
<EmbedInteropTypes>True</EmbedInteropTypes>
55-
</Reference>
56-
<Reference Include="Microsoft.Vbe.Interop, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
57-
<HintPath>packages\ExcelDna.Interop.14.0.1\lib\Microsoft.Vbe.Interop.dll</HintPath>
58-
<EmbedInteropTypes>True</EmbedInteropTypes>
59-
</Reference>
60-
<Reference Include="Office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
61-
<HintPath>packages\ExcelDna.Interop.14.0.1\lib\Office.dll</HintPath>
62-
<EmbedInteropTypes>True</EmbedInteropTypes>
63-
</Reference>
64-
<Reference Include="System" />
65-
<Reference Include="System.Data" />
66-
<Reference Include="System.Xml" />
67-
<Reference Include="System.Core" />
68-
<Reference Include="System.Xml.Linq" />
69-
<Reference Include="System.Data.DataSetExtensions" />
70-
<Reference Include="System.Net.Http" />
71-
</ItemGroup>
72-
<ItemGroup>
73-
<Import Include="Microsoft.VisualBasic" />
74-
<Import Include="System" />
75-
<Import Include="System.Collections" />
76-
<Import Include="System.Collections.Generic" />
77-
<Import Include="System.Data" />
78-
<Import Include="System.Diagnostics" />
79-
<Import Include="System.Linq" />
80-
<Import Include="System.Xml.Linq" />
81-
<Import Include="System.Threading.Tasks" />
82-
</ItemGroup>
83-
<ItemGroup>
84-
<Compile Include="Functions.vb" />
85-
<Compile Include="My Project\AssemblyInfo.vb" />
86-
<Compile Include="My Project\Application.Designer.vb">
87-
<AutoGen>True</AutoGen>
88-
<DependentUpon>Application.myapp</DependentUpon>
89-
</Compile>
90-
<Compile Include="My Project\Resources.Designer.vb">
91-
<AutoGen>True</AutoGen>
92-
<DesignTime>True</DesignTime>
93-
<DependentUpon>Resources.resx</DependentUpon>
94-
</Compile>
95-
<Compile Include="My Project\Settings.Designer.vb">
96-
<AutoGen>True</AutoGen>
97-
<DependentUpon>Settings.settings</DependentUpon>
98-
<DesignTimeSharedInput>True</DesignTimeSharedInput>
99-
</Compile>
100-
<Compile Include="Ribbon.vb" />
101-
</ItemGroup>
102-
<ItemGroup>
103-
<EmbeddedResource Include="My Project\Resources.resx">
104-
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
105-
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
106-
<CustomToolNamespace>My.Resources</CustomToolNamespace>
107-
<SubType>Designer</SubType>
108-
</EmbeddedResource>
109-
</ItemGroup>
110-
<ItemGroup>
111-
<None Include="RibbonBasics-AddIn.dna" />
112-
<None Include="My Project\Application.myapp">
113-
<Generator>MyApplicationCodeGenerator</Generator>
114-
<LastGenOutput>Application.Designer.vb</LastGenOutput>
115-
</None>
116-
<None Include="My Project\Settings.settings">
117-
<Generator>SettingsSingleFileGenerator</Generator>
118-
<CustomToolNamespace>My</CustomToolNamespace>
119-
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
120-
</None>
121-
<None Include="packages.config" />
122-
<None Include="Properties\ExcelDna.Build.props" />
123-
</ItemGroup>
124-
<ItemGroup>
125-
<Content Include="Images\MagicWand.png">
126-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
127-
</Content>
128-
</ItemGroup>
129-
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
130-
<Import Project="packages\ExcelDna.AddIn.1.1.1\build\ExcelDna.AddIn.targets" Condition="Exists('packages\ExcelDna.AddIn.1.1.1\build\ExcelDna.AddIn.targets')" />
131-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
132-
<PropertyGroup>
133-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
134-
</PropertyGroup>
135-
<Error Condition="!Exists('packages\ExcelDna.AddIn.1.1.1\build\ExcelDna.AddIn.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\ExcelDna.AddIn.1.1.1\build\ExcelDna.AddIn.targets'))" />
136-
</Target>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>net472</TargetFrameworks>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<Content Include="RibbonResources\MagicWand.png">
7+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
8+
</Content>
9+
</ItemGroup>
10+
<ItemGroup>
11+
<PackageReference Include="ExcelDna.Addin" Version="*-*" />
12+
<PackageReference Include="ExcelDna.Interop" Version="15.0.1" />
13+
</ItemGroup>
14+
<ItemGroup>
15+
<Compile Update="RibbonResources\RibbonResources.Designer.vb">
16+
<DesignTime>True</DesignTime>
17+
<AutoGen>True</AutoGen>
18+
<DependentUpon>RibbonResources.resx</DependentUpon>
19+
</Compile>
20+
</ItemGroup>
21+
<ItemGroup>
22+
<EmbeddedResource Update="RibbonResources\RibbonResources.resx">
23+
<CustomToolNamespace>My.Resources</CustomToolNamespace>
24+
<Generator>ResXFileCodeGenerator</Generator>
25+
<LastGenOutput>RibbonResources.Designer.vb</LastGenOutput>
26+
</EmbeddedResource>
27+
</ItemGroup>
13728
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<customUI xmlns='http://schemas.microsoft.com/office/2009/07/customui' loadImage='LoadImage'>
3+
<ribbon>
4+
<tabs>
5+
<tab id='tab1' label='My Tab'>
6+
<group id='group1' label='My Group'>
7+
<button id='button1' label='My Button' onAction='OnSayHelloPressed' image='MagicWand'/>
8+
</group>
9+
</tab>
10+
</tabs>
11+
</ribbon>
12+
</customUI>

0 commit comments

Comments
 (0)