打开文件 [英] Open A File

查看:86
本文介绍了打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个宏来测试文件是否已经打开。如果不是,则打开文件,如果是,则激活打开的文件:

I have a macro that tests if a file is already open. If it isn't then it opens the file, if it is, then it activates the open file:

CODE :( Fname是文件的名称+扩展名)....(FyleName包含路径+文件+扩展名)

CODE: (Fname is the name of the file+extension)....(FyleName contains the path+file+extension)

如果FileOpen = False _

           然后是Workbooks.Open文件名:= FyleName,UpdateLinks:= True _

                其他工作簿(FName)。激活

If FileOpen = False _
            Then Workbooks.Open filename:=FyleName, UpdateLinks:=True _
                Else Workbooks(FName).Activate

问题

这段代码在我的XP系统上很长时间以来一直很好用。

This code has served me well for a long time on my XP system.

我现在买了一个新系统,带有Office 2013的Windows7 .... ..代码行打开了所需的文件,但是一旦文件打开,宏就会停止执行。

I have now bought a new system, Windows7 with Office 2013......The line of code opens the required file, but as soon as the file is open the macro stops executing.

任何人都可以帮我解决这个问题。这是令人难以置信的重要。

Can anyone help me to overcome this. It is unbelievably important.

推荐答案

进行了大量测试后,我关闭了工作簿。

Having carried out numerous tests, I closed the workbook.

当我重新打开时,它有效。

When I reopened, it worked.

只是一个小故障


这篇关于打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆