【发布时间】:2015-09-18 23:21:04
【问题描述】:
我收到运行时错误 1004:cancheckout 方法在 cancheckout 附近失败,并且
编译错误:在行中找不到方法或数据成员
If Workbooks.CanCheckIn(ChkFile) = True Then
我该如何解决这个问题?
Sub ToCheck()
Dim xlApp As Excel.Application
Dim wb As Workbook
Dim ChkFile As String
ChkFile = "http://new1....com/Shared%20Documents/file.xlsm"
If Workbooks.CanCheckOut(ChkFile) = True Then 'getting error here
Workbooks.CheckOut ChkFile
Set xlApp = New Excel.Application
xlApp.Visible = True
Set wb = xlApp.Workbooks.Open(ChkFile, , False)
End If
ThisWorkbook.Activate
Application.Run ("'file.xlsm'!Macro1")
ThisWorkbook.Save
Workbooks(ChkFile).Activate
If Workbooks.CanCheckIn(ChkFile) = True Then 'Getting error here
Workbooks(ChkFile).CheckIn
End If
End Sub
【问题讨论】:
-
您可以通过其他方式访问该文件吗(例如,通过将 url 粘贴到网络浏览器中)?
-
您确定要在Sub的末尾签入文件,即使您在开头没有签出它?
标签: vba checkin vcs-checkout