ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   problems with dialogs (https://www.excelbanter.com/excel-programming/323626-problems-dialogs.html)

François

problems with dialogs
 
Hello
I'm using a dialog to give easier access to macros.
But when running a macro after the dialog (still open) I got a error msg if
I tried to open anoter dialog like (printer dialog).
How to solve this .? I have tried to use sendkeys (% F4) to close the first
one but without success to close it like this.

Thanks.

Bob Phillips[_6_]

problems with dialogs
 
What dialog are you initially running for easier access to macros?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"François" wrote in message
...
Hello
I'm using a dialog to give easier access to macros.
But when running a macro after the dialog (still open) I got a error msg

if
I tried to open anoter dialog like (printer dialog).
How to solve this .? I have tried to use sendkeys (% F4) to close the

first
one but without success to close it like this.

Thanks.




François

problems with dialogs
 
a custom dialog created under Excel (insert / MS 5.0 Excel Dialog)

Thannks for your help.

"Bob Phillips" wrote:

What dialog are you initially running for easier access to macros?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"François" wrote in message
...
Hello
I'm using a dialog to give easier access to macros.
But when running a macro after the dialog (still open) I got a error msg

if
I tried to open anoter dialog like (printer dialog).
How to solve this .? I have tried to use sendkeys (% F4) to close the

first
one but without success to close it like this.

Thanks.





Bob Phillips[_6_]

problems with dialogs
 
I feared that might be what you were using. I don't know why you get the
problem since it is many years since I have used the MS 5.0 Excel Dialog.
Could you not create a use3rform for you macro initiation rather than this
old dialog?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"François" wrote in message
...
a custom dialog created under Excel (insert / MS 5.0 Excel Dialog)

Thannks for your help.

"Bob Phillips" wrote:

What dialog are you initially running for easier access to macros?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"François" wrote in message
...
Hello
I'm using a dialog to give easier access to macros.
But when running a macro after the dialog (still open) I got a error

msg
if
I tried to open anoter dialog like (printer dialog).
How to solve this .? I have tried to use sendkeys (% F4) to close the

first
one but without success to close it like this.

Thanks.







Tom Ogilvy

problems with dialogs
 
insert / MS 5.0 Excel Dialog inserts a dialogsheet. The code you post all
the time (and modify all the time) is based on the dialogsheet. What do you
interpret him to be talking about?

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
I feared that might be what you were using. I don't know why you get the
problem since it is many years since I have used the MS 5.0 Excel Dialog.
Could you not create a use3rform for you macro initiation rather than this
old dialog?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"François" wrote in message
...
a custom dialog created under Excel (insert / MS 5.0 Excel Dialog)

Thannks for your help.

"Bob Phillips" wrote:

What dialog are you initially running for easier access to macros?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"François" wrote in message
...
Hello
I'm using a dialog to give easier access to macros.
But when running a macro after the dialog (still open) I got a error

msg
if
I tried to open anoter dialog like (printer dialog).
How to solve this .? I have tried to use sendkeys (% F4) to close

the
first
one but without success to close it like this.

Thanks.








Peter T

problems with dialogs
 
I don't think you can run an Application.Dialog at same time as your Dialog
form. Try OnTime method:

'// in a normal module
'// from Forms toolbar, put a button on Dialog1 and
'// assign it to BtnPrint

Public Arg
Sub Main()
ThisWorkbook.DialogSheets("Dialog1").Show
End Sub

Sub ReShowMyDialog(Optional n As Long)
'whatever initialization code
If n = 123 Then
MsgBox "User cancelled print dialog"
'If IsArray(Arg) Then Erase Arg
End If
Main
End Sub

Sub BtnPrint()
Dim j As Long

Arg = Array(2, 1, 2) '(Page(s), From 1, To 2)
j = 123

Application.OnTime Now, " 'PrintShow " & j & " ' "
ThisWorkbook.DialogSheets("Dialog1").Hide
End Sub

Sub PrintShow(Optional num As Long)
Dim x
x = Application.Dialogs(xlDialogPrint).Show(Arg(0), Arg(1), Arg(2))
If x = False And num = 123 Then
ReShowMyDialog num
Else: Erase Arg
End If
End Sub

Regards,
Peter T

"François" wrote in message
...
a custom dialog created under Excel (insert / MS 5.0 Excel Dialog)

Thannks for your help.

"Bob Phillips" wrote:

What dialog are you initially running for easier access to macros?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"François" wrote in message
...
Hello
I'm using a dialog to give easier access to macros.
But when running a macro after the dialog (still open) I got a error

msg
if
I tried to open anoter dialog like (printer dialog).
How to solve this .? I have tried to use sendkeys (% F4) to close the

first
one but without success to close it like this.

Thanks.








All times are GMT +1. The time now is 06:05 AM.

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