VBA show a Dialog Box in another Workbook

ibbo

New Member
Joined
Sep 8, 2011
Messages
3
Hello,

Is it possible to display a dialog sheet in a different workbook without transferring the dialog sheet to the second workbook?

I am running the code from "Book1":
Application.Run ("'Tray Stock 2.xlsm'!showmsgbox")

showmsgbox code appears as:
Sheets("Sheet1").Select
With DialogSheets("Dialog1")
DialogSheets("Dialog1").Show

The issue I have is that the dialog box shows in Tray Stock 2 workbook and not book1. When I have specified Workbooks("Book1").activate before selecting the worksheet I get error "subscript out of range".

running the code from "Book1" works like a dream, the only problem is the dialog sheet displaying in the wrong workbook.

Any help would be appreciated.

Best Regards,
Jonathan
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I dont have much idea about dialogue sheets. doees it have a property of ShowModal like a userform. Try playing with this property.
 
Upvote 0
Thanks for the speedy response.

I will have a play with userforms/modal property, however as the second workbook is on a seperate computer on a shared harddrive within the same network I am not sure where to start.

I will keep you posted if I find a solution.

Thanks again
 
Upvote 0
your solution worked! The issue was that the dialog sheet is based within "Tray Stock 2", whereas if I use a userform (attached to Tray Stock 2) in Vb editor I can display the popup on a different workbook by running the macro from Book1, as long as both workbooks are open.

There will probably be a way to do the same using a dialog sheet, however this solution worked for me.

Thank you.
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,626
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top