宏判断是否为Excel打开,若不是则关闭表格

宏代码:

Public Function is_wp()
    Debug.Print "Application.Build:" & vbCrLf & Application.Build
    Debug.Print "Application.Caption:" & vbCrLf & Application.Caption
    Debug.Print "Application.ActiveWorkbook.Name:" & vbCrLf & Application.ActiveWorkbook.Name
    
    is_wp = InStr(Replace(UCase(Application.Caption), UCase(Application.ActiveWorkbook.Name), ""), "WPS") > 0
    If Application.Caption <> "工作人员通讯录.xlsm - Excel" Then
        ActiveWorkbook.Close Savechanges:=False
    End If

  

Private Sub Workbook_Open()
Call Sheet1.is_wp
Call Sheet1.main
End Sub

 

宏判断是否为Excel打开,若不是则关闭表格

上一篇:DM-GAN Dynamic Memory Generative Adversarial Networks for Text-to-Image Synthesis论文阅读笔记


下一篇:linux环境搭建DM数据库