VBA中获取文件名的方法

Sunday, March 2nd, 2008

在用excel做文件导入时发现,一旦使用Commond Dialogs 就会出错 "The control could not be created because it is not properly licensed" 原因是,Commond Dialogs are not licensed to be used in Excel。经过搜索发现,其实VBA还有其它的法子获得文件路径。 [code:vb] Private Function OpenDialog() As String Dim sFile As String Dim n As Integer sFile = Application.GetOpenFilename("MS ...