ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   multi-page control questions... (https://www.excelbanter.com/excel-programming/306045-multi-page-control-questions.html)

mark

multi-page control questions...
 
I'm trying to learn to use the multi-page control a
little, and started out right with the online help's
example.

However, when it tries to execute the line:

Set MyTextBox = MultiPage1.Pages
(MultiPage1.Value).Controls.Add
("MSForms.TextBox.1", "MyTextBox", Visible)

(line is not broken into 3 lines in the code, continuation
characters are not the problem),

I get the error:

***************
Run-time error '-2147221005(800401f3)':

Invalid class string
***************

Well, that's all well and good, but I assume it's actually
trying to tell me something?

My guess as to what that would be is that it doesn't
recognize the "MSForms.TextBox.1" part of the .add code?

But, assuming I'm correct, my trouble is that I don't know
where to go to fix that. I'm hoping others know.

And, if one were to want to switch from one page of a
multipage to another, in code, what ist the method or
command?

it's not .select it's not .activate, it's not .setfocus,
it's not .goto, it's not.....

what is it?

(and, I dont' suppose there's anyone who has yet come up
with a way to get MS Help to BE helpful?)







Vasant Nanavati

multi-page control questions...
 
The following should work (and no, I can't explain why):

Dim MyTextBox As msforms.TextBox
Set MyTextBox = MultiPage1.Pages(MultiPage1.Value) _
.Controls.Add("Forms.TextBox.1", "MyTextBox", Visible)

--

Vasant


"mark" wrote in message
...
I'm trying to learn to use the multi-page control a
little, and started out right with the online help's
example.

However, when it tries to execute the line:

Set MyTextBox = MultiPage1.Pages
(MultiPage1.Value).Controls.Add
("MSForms.TextBox.1", "MyTextBox", Visible)

(line is not broken into 3 lines in the code, continuation
characters are not the problem),

I get the error:

***************
Run-time error '-2147221005(800401f3)':

Invalid class string
***************

Well, that's all well and good, but I assume it's actually
trying to tell me something?

My guess as to what that would be is that it doesn't
recognize the "MSForms.TextBox.1" part of the .add code?

But, assuming I'm correct, my trouble is that I don't know
where to go to fix that. I'm hoping others know.

And, if one were to want to switch from one page of a
multipage to another, in code, what ist the method or
command?

it's not .select it's not .activate, it's not .setfocus,
it's not .goto, it's not.....

what is it?

(and, I dont' suppose there's anyone who has yet come up
with a way to get MS Help to BE helpful?)









mark

multi-page control questions...
 
The following should work (and no, I can't explain why):


Thanks, Vasant.

Do you know how to move from one page to another,
programatically?

Vasant Nanavati

multi-page control questions...
 
It is not intuitive.

MultiPage1.Value = 0

will take you to Page1, etc.

--

Vasant

"mark" wrote in message
...
The following should work (and no, I can't explain why):



Thanks, Vasant.

Do you know how to move from one page to another,
programatically?




mark

multi-page control questions...
 
Ahhh!

I noticed that the multipage control had a value method,
but I didn't think to try it for moving among the pages!

Thanks.

-----Original Message-----
It is not intuitive.

MultiPage1.Value = 0

will take you to Page1, etc.




All times are GMT +1. The time now is 01:28 PM.

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