I'm trying to find all controls on msform from c# using VBA extensibility interop.
I can find all forms using :
using System;
using Microsoft.Office.Interop.Excel
using Microsoft.Vbe.Interop;
using Microsoft.Vbe.Interop.Forms;
.....
foreach (Microsoft.Vbe.Interop.VBComponent mycom in wb.VBProject.VBComponents)
{
if (mycom.Type == Editor.vbext_ComponentType.vbext_ct_MSForm)
.....
but i can't find the controls on that form.
I think it should look something like :
....
foreach (Microsoft.Vbe.Interop.Forms.Control ctrl in Microsoft.Vbe.Interop.VBComponent.Designer.Controls)
....
but the Controls collection is not recognized.
Any ideas?