Created
December 15, 2016 23:52
-
-
Save TSKGunGun/73f9fc99c318c5d22fc30c2e1a23c5ee to your computer and use it in GitHub Desktop.
VBAでC#のdllを使うサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
using System.ComponentModel; | |
using System.Runtime.InteropServices; | |
namespace VBA_SampleAddin | |
{ | |
[ComVisible(true)] | |
public interface IVBA_Addin | |
{ | |
[Description("HelloWorldを出力します。")] | |
string HelloWorld(string name); | |
} | |
[ComVisible(true)] | |
[ClassInterface(ClassInterfaceType.None)] | |
public class VBA_Addin : IVBA_Addin | |
{ | |
/// <summary> | |
/// HelloWorld | |
/// </summary> | |
public string HelloWorld(string name) | |
{ | |
string msg = "Hello World! " + name; | |
return msg; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment