PDA

View Full Version : Word XP Macro



Greg
22-11-2002, 10:38 PM
Trying to run a macro in Word whereby you move the cursor from the Word Doc to an embedded excel worksheet and then open the worksheet to edit - but can't get a keyboard command to move to the worksheet.
Any ideas? Cheers

Oxie
23-11-2002, 08:35 AM
Greg,

How about using Alt + Tab?

Greg
23-11-2002, 10:58 AM
No luck Oxie - that just moves between open applications.
Thanks though

parry
24-11-2002, 09:59 AM
Hi Greg, I see what you mean. When running the record macro you cant actually select the worksheet object. However I think I found the answer for you in VBA help. Try this...

Sub ExcelObject()
ActiveDocument.InlineShapes(1).Activate

End Sub

The number in brackets after InlineShapes seems to indicate the object name in reference to where it sits within the Word doc. So for example you had three embedded worksheets in the same Word doc then the third one down in the document would be referenced by ActiveDocument.InlineShapes(3).Activate

cheers
Parry

Greg
26-11-2002, 12:59 PM
You've done it again Parry :)
Cheers