show userfrom from another application

  • Thread starter Thread starter marwan hefnawy
  • Start date Start date
M

marwan hefnawy

I have an Excel workbook that contains a userform .
My Question is, How can I show the userform from a powerpoint presentation.
I can open my workbook from PowerPoint as following
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWB = xlApp.Workbooks.Open("C:\folder_name\file_name.xls")

the above code works fine and opens the Excel workbook, but how to show the
userform??
Thanks.
 
AFAIK you cannot show an Excel userform via automation in the way you are
suggesting.

There are 2 choices that I can think of.
1. Run a macro in the target workbook ("C:\folder_name\file_name.xls") that
shows the form using automation (xlApp.Run myMacro)
2. Create a workbook open event in the target workbook that shows the form
on opening

A third possible way is to create a PowerPoint form? I don't know if this is
possible, not tested it, so I will leave you to try this if you wish.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top