LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Displaying an Excel Range

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
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
Displaying range value when range name is concatenated Barb Reinhardt Excel Discussion (Misc queries) 5 November 6th 06 06:11 PM
Displaying something within a range name in an Excel Header Barb Reinhardt Excel Programming 0 October 12th 06 08:34 PM
I displaying a range in Time within a cell in Excel. Moricj Excel Discussion (Misc queries) 1 May 4th 06 01:04 PM
displaying data from a range [email protected] Excel Programming 3 March 4th 06 04:00 AM
Displaying target range across the Y axis. Gary Clarke Charts and Charting in Excel 3 June 14th 05 01:16 PM


All times are GMT +1. The time now is 08:05 AM.

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"