ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   show userfrom from another application (https://www.excelbanter.com/excel-programming/286295-show-userfrom-another-application.html)

marwan hefnawy

show userfrom from another application
 
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.



Bob Phillips[_6_]

show userfrom from another application
 
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)

"marwan hefnawy" wrote in message
...
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.






All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com