AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Office 2007 Ribbon Problem (Excel 2007, to be more specific)

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
thinkstorm



Joined: 17 Aug 2004
Posts: 38

PostPosted: Sun Feb 01, 2009 3:19 am    Post subject: Office 2007 Ribbon Problem (Excel 2007, to be more specific) Reply with quote

Hello,

I did a search through the forums but didn't really find anything other than COM programmig (yuck!). In Excel 2003 I could easily call some keyboard shortcuts, such as !t-u-t to show preceeding cells.

In Excel 2007 the same shortcut is !m-p. I can easily call this shortcut, but then the ribbon changes to the Formulas Ribbon. Any idea how to change it back to the Ribbon where I cam from without COM?

I hate calling pixel functions to get the current color of the selected menu....
_________________
Cheers,

Thorsten
Back to top
View user's profile Send private message
Fluffy



Joined: 11 Aug 2008
Posts: 19

PostPosted: Sun Feb 01, 2009 2:13 pm    Post subject: Reply with quote

Your shortcut is incorrect. To use the Ribbon shortcuts, pressing Alt highlights the main ribbon options (Home, insert, page layout, formulas e.t.c.) and M is the key for the formula ribbon. You have to press the key for whatever ribbon you want before pressing the keys to send commands to that ribbon.
Back to top
View user's profile Send private message Send e-mail
thinkstorm



Joined: 17 Aug 2004
Posts: 38

PostPosted: Sun Feb 01, 2009 3:52 pm    Post subject: Reply with quote

First of all, pressing ALT-m, then p does mark the preceding cell with the little blue arrow. So I could call
Code:
SendInput, !{m}{p}

works fo me.

Second, my problem is not to invoke the keyboard shortcut, but to determine how to change back the ribbon to the one where I came from: If I'm on the "Home" ribbon it changes to the "Formulas" ribbon - quite annoying...
_________________
Cheers,

Thorsten
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Sun Feb 01, 2009 5:07 pm    Post subject: Reply with quote

office 20007 yuck!
aside from windows ME this is the worst hunk of trash ever published by Microsoft
I have fortunately reverted to 2003
However the COM should work the same

first example shows creating new workbook and creating formula and executing request
Code:
;~ initialize COM
COM_CoInitialize()
;~ create an instance of Excel
oExcel:= COM_ActiveXObject("Excel.Application")
COM_Invoke(oExcel, "Visible=", true)
;~ add a workbook
Workbook:=COM_InvokeDeep(oExcel, "Workbooks.Add")
;~ the link to COM_InvokeDeep
;~ http://www.autohotkey.com/forum/viewtopic.php?p=225616#225616
;~ Set a formula
COM_InvokeDeep(Workbook,"Worksheets.item[Sheet1].Cells.item[4].item[2].value","=a7")
;~ Activate a cell
COM_InvokeDeep(Workbook,"worksheets.item[Sheet1].Cells.item[4].item[2].activate")
;~ execute the show precidence procedure
COM_InvokeDeep(oExcel,"Selection.ShowPrecedents")
;~ end the com interface
COM_CoUninitialize()
Second example a hot key executable on existing selections
Code:
;~ using only an active already open excel with a cell already selected
!t::
COM_CoInitialize()
oExcel := COM_GetActiveObject("Excel.Application")
COM_InvokeDeep(oExcel,"Selection.ShowPrecedents")
COM_CoUninitialize()
Return

_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
thinkstorm



Joined: 17 Aug 2004
Posts: 38

PostPosted: Sun Feb 01, 2009 5:44 pm    Post subject: Reply with quote

Oh my, I was afraid I had to use COM... might not be worth the trouble, I guess I will learn all the new shortcuts... thanks for the examples, they should be sufficiernt to help me along.
_________________
Cheers,

Thorsten
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Sun Feb 01, 2009 9:52 pm    Post subject: Reply with quote

thinkstorm wrote:
Oh my, I was afraid I had to use COM... might not be worth the trouble, I guess I will learn all the new shortcuts... thanks for the examples, they should be sufficiernt to help me along.

What trouble??
ok whatever
_________________

We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group