ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBModal Error (https://www.excelbanter.com/excel-programming/307973-vbmodal-error.html)

Jenny

VBModal Error
 
Ok, I have a macro with a userform in it called MainForm.
When I try to run the command MainForm.Show VbModal I get
an error. It tells me that the method is not recognized
(and it highlights VbModal). When I change the command to
MainForm.Show 1 (which is the same as the previous
command) I get an error saying that there are the wrong
number of arguments.

Also, I only get this error on machines running Windows
98. I registered the appropriate DLLs and I have done
everything else I can think of to fix this. Can someone
please tell me why this is happening and how to fix it?

Thanks!

~Jenny

Tom Ogilvy

VBModal Error
 
Excel 97 didn't have any arguments to the Show command I don't believe (at
least it didn't support modeless userforms, so no reason to have an
argument). Are these machines running xl97?

--
Regards,
Tom Ogilvy

"Jenny" wrote in message
...
Ok, I have a macro with a userform in it called MainForm.
When I try to run the command MainForm.Show VbModal I get
an error. It tells me that the method is not recognized
(and it highlights VbModal). When I change the command to
MainForm.Show 1 (which is the same as the previous
command) I get an error saying that there are the wrong
number of arguments.

Also, I only get this error on machines running Windows
98. I registered the appropriate DLLs and I have done
everything else I can think of to fix this. Can someone
please tell me why this is happening and how to fix it?

Thanks!

~Jenny




Jenny

VBModal Error
 
Tom,
Ah, it appears that they are using XL97. I can just write
a bit of code to check the version before it calls the
show event. Thank you for helping out with this one!

~Jen

-----Original Message-----
Excel 97 didn't have any arguments to the Show command I

don't believe (at
least it didn't support modeless userforms, so no reason

to have an
argument). Are these machines running xl97?

--
Regards,
Tom Ogilvy

"Jenny" wrote in

message
...
Ok, I have a macro with a userform in it called

MainForm.
When I try to run the command MainForm.Show VbModal I

get
an error. It tells me that the method is not recognized
(and it highlights VbModal). When I change the command

to
MainForm.Show 1 (which is the same as the previous
command) I get an error saying that there are the wrong
number of arguments.

Also, I only get this error on machines running Windows
98. I registered the appropriate DLLs and I have done
everything else I can think of to fix this. Can someone
please tell me why this is happening and how to fix it?

Thanks!

~Jenny



.


Michel Pierron

VBModal Error
 
Hi Jenny;
With xl97, you can use:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function EnableWindow Lib "user32" _
(ByVal hwnd As Long, ByVal fEnable As Long) As Long

Private Sub UserForm_Activate()
EnableWindow FindWindow(vbNullString, Application.Caption), 1
End Sub

MP

"Jenny" a écrit dans le message de
...
Tom,
Ah, it appears that they are using XL97. I can just write
a bit of code to check the version before it calls the
show event. Thank you for helping out with this one!

~Jen

-----Original Message-----
Excel 97 didn't have any arguments to the Show command I

don't believe (at
least it didn't support modeless userforms, so no reason

to have an
argument). Are these machines running xl97?

--
Regards,
Tom Ogilvy

"Jenny" wrote in

message
...
Ok, I have a macro with a userform in it called

MainForm.
When I try to run the command MainForm.Show VbModal I

get
an error. It tells me that the method is not recognized
(and it highlights VbModal). When I change the command

to
MainForm.Show 1 (which is the same as the previous
command) I get an error saying that there are the wrong
number of arguments.

Also, I only get this error on machines running Windows
98. I registered the appropriate DLLs and I have done
everything else I can think of to fix this. Can someone
please tell me why this is happening and how to fix it?

Thanks!

~Jenny



.





All times are GMT +1. The time now is 10:09 AM.

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