【发布时间】:2017-05-04 03:05:23
【问题描述】:
我创建了一个用户窗体,它包含一个打开的 PowerPoint 文件的列表,并让用户选择他们想要使用的文件。当他们单击“设置 PowerPoint”按钮时,我想将该按钮传递给 VBA 模块,在该模块中我会将 PowerPoint 设置为用户刚刚选择的那个。任何帮助将不胜感激。
用户窗体代码:
Option Explicit
Public SelectedPPT As String
Private Sub cmdCloseForm_Click()
Unload Me
End Sub
Private Sub ComboBox1_Change()
ComboBox1.RowSource = "Array"
End Sub
Private Sub setPPT_Click()
'Not sure if this is the best way to select the ppt the user has chosen?
SelectedPPT = Me.ComboBox1.Value
End Sub
那么我如何获取 SelectedPPT 并将其传递给模块,以便我可以选择特定的 PowerPoint?
【问题讨论】:
-
function PassPPT(strSelectedPPT as string)......end function使用PassPPT(me.combobox1.value)