Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.vb.winapi,microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Sheet Tabs: API manipulation to a multiline TabControl

Has anyone ever managed to get a window handle for the sheet tabs control and
run SendMessage TCS_MULTILINE?

SPY++ is surprisingly unhelpful: the EXCEL7 window for the active workbook
has the expected scrollbars, and three XLCTL windows which I am unable to
identify. None of them respond to SendMessage(hwndCtrl, TCS_MULTILINE, 0&,
0&) - actually, I'd be interested to know what these controls are...

As for the reason I'm doing this, I have some workbooks here with 20 to 30
tabs, and the users want faster navigation. Yes, I could populate a menubar
dynamically with navigation buttons for each worksheet in the current
workbook, and dock it to the bottom of the XLDESK window. But I like lazy
solutions.
  #2   Report Post  
Posted to microsoft.public.vb.winapi,microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Sheet Tabs: API manipulation to a multiline TabControl

I doubt the sheet tabs are windows. Anyway, do your users know about the
built-in sheet list feature (right-click on one of the four little arrow
heads in the lower left corner of the worksheet window)?

--
Jim
"Nile_Hef" wrote in message
...
| Has anyone ever managed to get a window handle for the sheet tabs control
and
| run SendMessage TCS_MULTILINE?
|
| SPY++ is surprisingly unhelpful: the EXCEL7 window for the active workbook
| has the expected scrollbars, and three XLCTL windows which I am unable to
| identify. None of them respond to SendMessage(hwndCtrl, TCS_MULTILINE, 0&,
| 0&) - actually, I'd be interested to know what these controls are...
|
| As for the reason I'm doing this, I have some workbooks here with 20 to 30
| tabs, and the users want faster navigation. Yes, I could populate a
menubar
| dynamically with navigation buttons for each worksheet in the current
| workbook, and dock it to the bottom of the XLDESK window. But I like lazy
| solutions.


  #3   Report Post  
Posted to microsoft.public.vb.winapi,microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Sheet Tabs: API manipulation to a multiline TabControl

Ooh *SHINY!*

I didn't know about that menu. And if there's more than 16 sheets, clicking
the 'More Sheets...' menu option opens the 'Activate' dialogue, which I can
slip into the toolbar with this line of code:

Application.Dialogs(xlDialogActivate).Show

Thanks for that.

NH

"Jim Rech" wrote:

I doubt the sheet tabs are windows. Anyway, do your users know about the
built-in sheet list feature (right-click on one of the four little arrow
heads in the lower left corner of the worksheet window)?

--
Jim

  #4   Report Post  
Posted to microsoft.public.vb.winapi,microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sheet Tabs: API manipulation to a multiline TabControl

Nile_Hef schrieb:
SendMessage(hwndCtrl, TCS_MULTILINE, 0&, 0&)

TCS_MULTILINE is a control style and no message. If you want to check
whether it is set, you would have to use something like this:

Dim style As Long

style = GetWindowLong(hwndCtrl, GWL_STYLE)
If style And TCS_MULTILINE Then
Debug.Print "Control uses TCS_MULTILINE!"
End If

And if you want to set this style, do it like this:

Dim style As Long

style = GetWindowLong(hwndCtrl, GWL_STYLE)
style = style Or TCS_MULTILINE
SetWindowLong hwndCtrl, GWL_STYLE, style

Timo
--
www.TimoSoft-Software.de - the home of ExplorerTreeView
Boycott DRM! Boycott HDCP!
  #5   Report Post  
Posted to microsoft.public.vb.winapi,microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Sheet Tabs: API manipulation to a multiline TabControl

Thanks for clarifying that: yes, I should be using SetWindowLong.

Unfortunately, the three XLCTL windows turn out to be resizing controls for
the workbook scrollbars; the TabStrip control is well and truly hidden.
Visible Excel objects are an odd mix of standard Windows components for
exotic jobs and exotic handcrafted objects for commonplace Windows actions.

Oh well: looks like I'll have to do some work... For people who value their
time so much that a worksheet tab that's scrolled out of view is uneconomical
to chase with the mouse.

Nile

__________________________________________________ ______________
"The Meek Shall Inherit The Earth. In very small plots, about six feet by
three"

"Timo Kunze" wrote:

Nile_Hef schrieb:
SendMessage(hwndCtrl, TCS_MULTILINE, 0&, 0&)

TCS_MULTILINE is a control style and no message. If you want to check
whether it is set, you would have to use something like this:

Dim style As Long

style = GetWindowLong(hwndCtrl, GWL_STYLE)
If style And TCS_MULTILINE Then
Debug.Print "Control uses TCS_MULTILINE!"
End If

And if you want to set this style, do it like this:

Dim style As Long

style = GetWindowLong(hwndCtrl, GWL_STYLE)
style = style Or TCS_MULTILINE
SetWindowLong hwndCtrl, GWL_STYLE, style

Timo
--
www.TimoSoft-Software.de - the home of ExplorerTreeView
Boycott DRM! Boycott HDCP!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
tabs are missing even though 'tools-options-view-sheet tabs' ok? rgranell Excel Worksheet Functions 3 August 16th 08 04:25 PM
Help with data manipulation between 2 worksheet tabs Ayo Excel Discussion (Misc queries) 3 November 28th 07 08:41 PM
Time sheet manipulation souchie40 Excel Discussion (Misc queries) 0 November 10th 06 09:04 AM
For better Performance in VBA for Excel - Strings manipulation OR Objects manipulation vmegha Excel Programming 2 December 19th 05 12:14 AM
Data manipulation within the same sheet MParham Setting up and Configuration of Excel 0 April 22nd 05 03:31 PM


All times are GMT +1. The time now is 10:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"