AutoHotkey Community

It is currently May 26th, 2012, 2:57 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: February 1st, 2009, 4:19 am 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 3:13 pm 
Offline

Joined: August 11th, 2008, 11:13 pm
Posts: 19
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 4:52 pm 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 6:07 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
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

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 6:44 pm 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 10:52 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
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

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], G. Sperotto, patgenn123 and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group