我收到这个错误:
需要运行时错误'424'对象
当我尝试运行此代码时:
Sub SuperSaveAs()
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim pathName As String
Dim myFileName As String
If (ActiveDocument.CustomDocumentProperties("_CheckOutSrcUrl").Value = True) Then
pathName = ActiveDocument.CustomDocumentProperties("_CheckOutSrcUrl").Value
myFileName = pathName + ActiveWorkbook.Name
ActiveWorkbook.SaveAs Filename:= _
myFileName _
, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Else
MsgBox "_CheckOutSrcUrl is missing"
End If
End Sub
Run Code Online (Sandbox Code Playgroud)
此宏与Excel中的按钮连接.宏检查自定义文档属性是否存在.如果存在自定义文档属性,则宏应将文件保存为值_CheckOutSrcUrl
(SharePoint目录).我该如何修复错误?