小编Nic*_*Try的帖子

测试属性名称是否存在

我收到这个错误:

需要运行时错误'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目录).我该如何修复错误?

excel vba excel-vba

4
推荐指数
1
解决办法
8873
查看次数

标签 统计

excel ×1

excel-vba ×1

vba ×1