Return the Object that belongs to a CodePage

BruceMutton

New Member
Joined
Feb 16, 2002
Messages
10
The opposite of this is easy to do, using
Code:
Object.CodePage
however
Code:
CodePage.Parent
only steps up the VBA object hierachy towards the VBE.

The only way I can think of is by brute force...
Code:
For Each <worksheet & object> In ThisWorkbook
  If <worksheet & object>.CodePage Is <codepage I'm looking for> Then
    Msgbox "This is the Object that belongs to the CodePage!"
  End If
Next <>

Any better ideas?
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi Bruce

What is a "CodePage" ? Is this a variable you have assigned?


>Object.CodePage

What is the Object?
 
Upvote 0
Dave, Ivan

Object has the usual VBA meaning. In this case it could be a workbook, sheet or activeX control,

CodePage is is the VBA script associated with the object. All event triggered code is put here by default. eg Private Sub Workbook_WindowDeactivate(ByVal Wn As Excel.Window)

and no, CodeName is the "code name" associated with an object, that can be refered to directly in VBA code, without using collection syntax
eg
Msgbox Worksheets("Data") 'using collection syntax
Msgbox Sheet1 'using CodeName

The helpfiles in Excel 2000 are a bit sketchy with regards to VBE objects, Excel97 even more so.
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

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