我可以“退房”吗?一个VBA文件? [英] Can I "Check Out" a file with VBA?

查看:73
本文介绍了我可以“退房”吗?一个VBA文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,

我有一个存储在SharePoint库中的启用宏的Excel工作簿,启用了版本控制和文档签出。  我想利用Workbook Open事件在文件打开时触发一些进程,但我似乎无法找到
来让宏"退出"的方法。该文件。  这可能吗?

I have a macro-enabled Excel workbook stored in a SharePoint library with versioning and document check-out enabled.  I would like to utilize the Workbook Open event to fire some processes when the file is opened, but I can't seem to figure out a way to get the macro to "check out" the document.  Is this possible?

我通常可以通过记录自己执行操作然后检查生成的VBA代码来获得一些见解。  在这种情况下,当我记录自己检出工作簿时会创建以下内容:

I can usually gain some insight by recording myself performing an action and then examining the generated VBA code.  In this case, the following is created when I record myself checking out the workbook:


Sub RecordedMacro()

 ExecuteExcel4Macro _

  "(""http://sharepoint/sites/teamsite/reports/Daily Costs.xlsx"",48)"

End Sub

推荐答案

看起来好像有
CanCheckOut
和CheckOut方法,但是如果从你想要检出的文件中运行它们就会失败。

Well it looks like there are CanCheckOut and CheckOut methods, but they fail if run from within the file you're trying to check out.

所以...文件可以签出自己吗?

So... is it possible for a file to check-out itself?

 

 


这篇关于我可以“退房”吗?一个VBA文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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