回复 1楼jixianqi的帖子
你好,
请使用以下代码测试:
- OpenFileDialog ofd = new OpenFileDialog();
- string s;
- ofd.Filter = "Excel files (*.xls)|*.xls";
- ofd.FilterIndex = 2;
- ofd.InitialDirectory = Application.StartupPath;
- ofd.RestoreDirectory = true;
- if (ofd.ShowDialog() == DialogResult.OK)
- {
- s = ofd.FileName;
- fpSpread1.ActiveSheet.OpenExcel(s, 0);
- }
复制代码 |