Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Automating Excel from Word (2007), I have a variable var3 that contains a
reference of the form SheetName!R#C#:R#C# Using, and without Activating Excel xlApp.GoTo Reference:=var3 Set datarange = xlApp.Selection datarange.Copy I can copy the required information to the clipboard so that it can be pasted into Word. If however, I make Excel visible, the nearest that I can come to actually selecting the range is to use xlApp.Visible = True var2 = Left(var3, InStr(var3, "!") - 1) xlApp.Worksheets(var2).Activate xlApp.GoTo Reference:=var3 and adding Set datarange = xlApp.Selection datarange.Copy to the above, does not necessarily cause the required range of cells to be copied (not that I really need to copy them in this situation,) Activating the Worksheet was necessary to get the Worksheet containing the range to be made the active Worksheet. When Excel is visible, is there a way to get it to actually select a specific range of cells? Thanks for any assistance. -- Doug Robbins - Word MVP |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Displaying range value when range name is concatenated | Excel Discussion (Misc queries) | |||
Displaying something within a range name in an Excel Header | Excel Programming | |||
I displaying a range in Time within a cell in Excel. | Excel Discussion (Misc queries) | |||
displaying data from a range | Excel Programming | |||
Displaying target range across the Y axis. | Charts and Charting in Excel |