ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Object not supporting property or method (https://www.excelbanter.com/excel-programming/275102-object-not-supporting-property-method.html)

Stuart[_5_]

Object not supporting property or method
 
With GetUserWkbk_PrintOptions()
.Show
gives the above error msg on '.Show'

If I amend it to:

GetUserWkbk_PrintOptions.Show
With GetUserWkbk_PrintOptions()
If .OKButton.Tag = "Selected" Then
MsgBox "OK Button was pressed"

then the form shows, but when returned to the
sbove code, 'If.OkButton...' returns the same
error.

Why is this happening in what I thought was
ok code, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003



Bob Phillips[_5_]

Object not supporting property or method
 
Stuart,

Ditch the () that you keep appending to a statement.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Stuart" wrote in message
...
With GetUserWkbk_PrintOptions()
.Show
gives the above error msg on '.Show'

If I amend it to:

GetUserWkbk_PrintOptions.Show
With GetUserWkbk_PrintOptions()
If .OKButton.Tag = "Selected" Then
MsgBox "OK Button was pressed"

then the form shows, but when returned to the
sbove code, 'If.OkButton...' returns the same
error.

Why is this happening in what I thought was
ok code, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003





Bob Phillips[_5_]

Object not supporting property or method
 
Stuart,

() to be used when declaring arrays, functions and subs. Not all variables,
just dynamic arrays.

Where else do you think you have seen it?

--

HTH

Bob Phillips

"Stuart" wrote in message
...
Works fine thanks.
So () only to be used when actually using variables?
But that can't be true, since I've seen many examples
where () is appended.

Regards.

"Bob Phillips" wrote in message
...
Stuart,

Ditch the () that you keep appending to a statement.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Stuart" wrote in message
...
With GetUserWkbk_PrintOptions()
.Show
gives the above error msg on '.Show'

If I amend it to:

GetUserWkbk_PrintOptions.Show
With GetUserWkbk_PrintOptions()
If .OKButton.Tag = "Selected" Then
MsgBox "OK Button was pressed"

then the form shows, but when returned to the
sbove code, 'If.OkButton...' returns the same
error.

Why is this happening in what I thought was
ok code, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003





Stuart[_5_]

Object not supporting property or method
 
Yes, must have thought that variable was an array.

Regards and thanks.

"Bob Phillips" wrote in message
...
Stuart,

() to be used when declaring arrays, functions and subs. Not all

variables,
just dynamic arrays.

Where else do you think you have seen it?

--

HTH

Bob Phillips

"Stuart" wrote in message
...
Works fine thanks.
So () only to be used when actually using variables?
But that can't be true, since I've seen many examples
where () is appended.

Regards.

"Bob Phillips" wrote in message
...
Stuart,

Ditch the () that you keep appending to a statement.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Stuart" wrote in message
...
With GetUserWkbk_PrintOptions()
.Show
gives the above error msg on '.Show'

If I amend it to:

GetUserWkbk_PrintOptions.Show
With GetUserWkbk_PrintOptions()
If .OKButton.Tag = "Selected" Then
MsgBox "OK Button was pressed"

then the form shows, but when returned to the
sbove code, 'If.OkButton...' returns the same
error.

Why is this happening in what I thought was
ok code, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003




All times are GMT +1. The time now is 03:42 PM.

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