为什么Excel 中有两种类型的控件? (2个按钮,2个组合框,2个复选框等...)
表单控件和ActiveX控件之间有什么区别 ?我应该使用哪一个?

我发现在线的一些代码示例使用我的控件,但其他代码没有.怎么会?
我如何处理每种类型,我该如何区分?
我正在从 Excel 电子表格自动生成 PowerPoint 报告。在我粘贴表格之前,我已经完成了这个过程。
我正在使用PPApp.CommandBars.ExecuteMso ("PasteSourceFormatting")该表格将表格粘贴到 PowerPoint ,表格在我的幻灯片上显示为一个形状(第三个形状)。
要引用我使用的新形状,Set pShape = Slide2.Shapes(Slide2.Shapes.Count)但现在当我粘贴时,pShape分配了“形状 2”(而不是“形状 3”)。在粘贴和分配对象之间有什么需要做的吗?
下面的代码,评论了问题发生的地方。(已删除完整代码;可在此处查看)
'Copy tables from Excel
Set rng = ws.Range("A:A")
rng.ColumnWidth = 22.75
Set rng = ws.Range("A4:C27")
'Copy the table range
Application.CutCopyMode = False
rng.Copy
Application.Wait (Now + TimeValue("0:00:02"))
'The issue occurs here!!! '-------------------------------------
'Paste the table in to the slide
Slide2.Select
PPApp.CommandBars.ExecuteMso ("PasteSourceFormatting")
'Name the new shape object
Set pShape = Slide2.Shapes(Slide2.Shapes.Count)
pShape.Name = "Slide_2_Table_1"
pShape.LockAspectRatio = …Run Code Online (Sandbox Code Playgroud) 我正在尝试从Excel工作表中的范围添加选项按钮.
For Each Value In OptionList
Set opt = UserForm3.Controls.Add("Forms.OptionButton.1", "radioBtn" & i, True)
opt.Caption = Value
opt.Top = opt.Height * i
opt.GroupName = "Options"
UserForm3.Width = opt.Width
UserForm3.Height = opt.Height * (i + 2)
i = i + 1
Next
Run Code Online (Sandbox Code Playgroud)
我想创建一个事件处理程序,以便radiobtn1在从用户运行代码时选择if .虽然我得到了很多答案,但这些是用于工作表用户表单的.
我的目的是处理VBA用户表单.请帮我解决一下你的想法.