Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default range variable won't assign (chartobject.topleftcell property)

Folks,

This one has me stumped; can an expert ride to the rescue please!!

In the code below the assignment marked **** doesn't work; rngTopLeft
remains resolutely NOTHING in the locals window. In an attempt to
trouble shoot I've added various debug statements to see whether the
information demanded by the assignment is available, and all print the
expected info to immediate window.

Suggestions, please, as to why the assignment to rngTopLeft doesn't
happen

Many thanks in anticipation

Matt


On Error Resume Next 'currClust not yet assigned, n'oubliez pas
If Not rngCluster = rngCurrentCluster Then 'change H & V offset
for charts in new cluster
If iChart = 1 Then 'chart was the very first chart
iHoffset = iHoffset + iXsize
iVoffset = 0
iChart = iChart + 1
**** rngTopLeft =
ActiveSheet.ChartObjects(ActiveSheet.ChartObjects. Count).TopLeftCell

Debug.Print ActiveSheet.Name: '-SHEET CORRECT
Debug.Print ActiveSheet.ChartObjects.Count: '-NUMBER CORRECT (1)
Debug.Print ActiveSheet.ChartObjects
_(ActiveSheet.ChartObjects.Count).TopLeftCell.Addr ess: '-CORRECT
ADDRESS
Debug.Print TypeName(ActiveSheet.ChartObjects
_(ActiveSheet.ChartObjects.Count).TopLeftCell): '- it's a range, now
there's a surprise NOT
Debug.Print ActiveSheet.ChartObjects
_(ActiveSheet.ChartObjects.Count).BottomRightCell. Address: '-CORRECT
ADDRESS

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default range variable won't assign (chartobject.topleftcell property)

You need the 'Set' keyword since you are working with an object
type variable.

Set rngTopLeft = _
ActiveSheet.ChartObjects(ActiveSheet.ChartObjects. Count).TopLeftCell--Cordially,Chip PearsonMicrosoft MVP - ExcelPearson Software Consulting, LLCwww.cpearson.com"Matthew Dodds" wrote in oglegroups.com... Folks, This one has me stumped; can an expert ride to the rescueplease!! In the code below the assignment marked **** doesn't work;rngTopLeft remains resolutely NOTHING in the locals window. In an attemptto trouble shoot I've added various debug statements to seewhether the information demanded by the assignment is available, and allprint the expected info to immediate window. Suggestions, please, as to why the assignment to rngTopLeftdoesn't happen Many thanks in anticipation Matt On Error Resume Next 'currClust not yet assigned,n'oubliez pas If Not rngCluster = rngCurrentCluster Then 'change H & Voffset for charts in new cluster If iChart = 1 Then 'chart was the very firstchart iHoffset = iHoffset + iXsize iVoffset = 0 iChart = iChart + 1 **** rngTopLeft =ActiveSheet.ChartObjects(ActiveSheet.ChartObject s.Count).TopLeftCell Debug.Print ActiveSheet.Name: '-SHEET CORRECT Debug.Print ActiveSheet.ChartObjects.Count: '-NUMBER CORRECT(1) Debug.Print ActiveSheet.ChartObjects _(ActiveSheet.ChartObjects.Count).TopLeftCell.Addr ess:'-CORRECT ADDRESS Debug.Print TypeName(ActiveSheet.ChartObjects _(ActiveSheet.ChartObjects.Count).TopLeftCell): '- it's arange, now there's a surprise NOT Debug.Print ActiveSheet.ChartObjects _(ActiveSheet.ChartObjects.Count).BottomRightCell. Address:'-CORRECT ADDRESS

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default range variable won't assign (chartobject.topleftcell property)

Thanks Chip. And apologies to the group. It was a long day and the tyro
in me was in the ascendant.

Reply
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
Property Let: assign return value of Double when passing String Tetsuya Oguma Excel Discussion (Misc queries) 1 March 3rd 06 08:01 AM
how to set a variable to a Chart? not ChartObject Rich Excel Programming 3 June 6th 05 07:49 PM
How to assign a variable in a range select Paul Excel Programming 5 June 3rd 05 11:50 PM
How can I assign a range starting cell based on a variable locati. feman007 Excel Discussion (Misc queries) 1 March 9th 05 11:41 PM
How can I assign a range starting cell based on a variable locati. feman007 Excel Worksheet Functions 3 March 9th 05 11:40 PM


All times are GMT +1. The time now is 12:41 PM.

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"