如何浏览Excel文件 [英] How to Browse Excel File
本文介绍了如何浏览Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何浏览Excel文件以获取其在Windows应用程序中的路径?
How to Browse Excel File to get its path in windows application?
推荐答案
嗨..
Hi..
Private Sub btnbrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbrowse.Click
Try
Dim dlg As New OpenFileDialog
dlg.InitialDirectory = Application.StartupPath
'dlg.InitialDirectory = "C:\Program Files\Default Company Name\ePolitices"
dlg.Filter = " (*.xlsx)|*.xlsx" 'Microsoft Excel File "
dlg.FilterIndex = 1
If dlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
txtname.Text = dlg.FileName
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
我希望这会对你有帮助....
I hope this will help you....
这篇关于如何浏览Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文