签出 - RefreshAll - 通过VBA中的宏签入SharePoint文件 [英] Check Out - RefreshAll - Check In SharePoint files via Macro in VBA
问题描述
您好,
我正在学习如何在VB中编写宏。我有14个文件发布到SharePoint,我需要编写一个宏来检查每个文件,刷新文件(每个文件中有一个refreshall宏)然后检查文件重新输入所有14个文件。当我尝试运行下面的宏时,我一直收到运行时错误9:无效的调用过程或参数。
非常感谢任何帮助。
谢谢,
<前lang =vb> < span class =code-keyword> Sub openFile()
Workbooks.Open Filename:= _
URL
工作表( ).Activate ' 目的地表
' 准备打印区域等的代码
如果工作簿.CanCheckOut( )= True 然后
ActiveWorkbook.CheckOut
否则
' 处理错误和关闭目标工作簿的代码
Ap plication.Run 2014财年CR CAM合格机会报告!refreshall
结束 如果
如果 ActiveWorkbook.CanCheckIn = True 然后
ActiveWorkbook.CheckIn
ActiveWorkbook.Close
MsgBox 文件已经签入。
End 如果
结束 Sub
9:尝试运行以下宏时无效的调用过程或参数 错误意味着它的内容;)
查看文档以查找错误来源并根据需要更改代码。
CanCheckOut Method [ ^ ]
CanCheckIn Method [ ^ ]
CheckIn方法 [ ^ ]
CheckOut方法 [ ^ ]
Hello,
I am just learning how to write macro's in VB. I have 14 files posted to a SharePoint and I need to write a macro that will check out each file, refresh the file (there is a refreshall macro in each file) then check the file back in for all 14 files. I keep receiving a run-time error 9: invalid call procedure or argument when I try to run the below macro.
Any help would be greatly appreciated.
Thanks,
Sub openFile()
Workbooks.Open Filename:= _
"URL"
Worksheets("").Activate 'Destination sheet
'code to prepare print area etc
If Workbooks.CanCheckOut("") = True Then
ActiveWorkbook.CheckOut
Else
'code to handle error and close destination workbook
Application.Run "FY14 CR CAM Qualified Opportunity Report!refreshall"
End If
If ActiveWorkbook.CanCheckIn = True Then
ActiveWorkbook.CheckIn
ActiveWorkbook.Close
MsgBox "The file has been checked in."
End If
End Sub
9: invalid call procedure or argument when I try to run the below macro error means exactly what it says ;)
Check the documentation to find the source of error and change the code to your needs.
CanCheckOut Method[^]
CanCheckIn Method[^]
CheckIn Method[^]
CheckOut Method[^]
这篇关于签出 - RefreshAll - 通过VBA中的宏签入SharePoint文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!