首页 > 解决方案 > 从另一个窗体调用控件获取错误:未找到方法或数据成员

问题描述

我在编译我的项目时遇到错误 Method or data member not found。按钮控件“btnViewUpdateRefresh”以其他形式存在。

Private Sub UserForm_Terminate()
Dim oSection As Word.Section
Dim oRange As Word.Range
Dim var

If Documents("PART V1.0.docm").ProtectionType <> wdNoProtection Then
    Documents("PART V1.0.docm").Unprotect "1234"
Else
End If

ThisDocument.Activate
ThisDocument.StoryRanges(wdMainTextStory).Delete

MainWindow.Show

Call MainWindow.btnViewUpdateRefresh_Click --> error points in here.

If Documents("PART V1.0.docm").ProtectionType <> wdNoProtection Then
Else
    Documents("PART V1.0.docm").Protect wdAllowOnlyFormFields, True, "1234"
End If

结束子

标签: vba

解决方案


推荐阅读