OpenFileDialog가 Windows Form에 있는데, Excel Add-In 내에서 동일한 작업을 수행하려고 할 때 아무 것도하지 않는 것 같습니다. 아래 코드는 내 코드입니다. 그러나 텍스트 상자, openFileDialog 및 단추 이름이 모두 동일하므로 문제가 어디에 있는지 알기 위해 고심하고 있습니다.Excel 추가 기능에 OpenFileDialog가 작동하지 않습니다?
public partial class DashboardControl : UserControl
{
public DashboardControl()
{
InitializeComponent();
}
private void DashboardControl_Load(object sender, EventArgs e)
{
}
private void fileLocationText_TextChanged(object sender, EventArgs e)
{
}
private void openFile_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
}
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
fileLocationText.Text = openFileDialog1.FileName;
}
}