show userfrom from another application

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.
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top