Tag: 文件位置

如何设置由macros创build的文件的位置

我正在通过macros将Excel文件转换为文本文件,我希望文本文件的位置与Excel工作表位置相同。 我的代码是: Dim strPath As String strPath = "MyFileName.dat" Dim fnum As Integer fnum = FreeFile() Open strPath For Output As #fnum 'my code Close #fnum 运行时总是进入文档。 我试过“../MyFileName.dat”,它与我尝试把excel工作表中的一些地点,但没有与所有的工作。 什么是正确的方法来做到这一点。 谢谢。