Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VB scripped works in Excel 2003 but fails in 2007

Our roll out of Office 2007 has been put on hold because our engineering
department has an excel spreadsheet in Excel 2003 they have used for years
but fails in Excel 2007

The error is
Run-time error '-2147417848 (800 10 108)':
Method 'Offset' of object 'Range' failed

When I run debug after the failure this is the section of code that is high
lighted
.Chart.SetSourceData _
Source:=.TopLeftCell.Offset(0, -3).Resize(RepMeasurements, 2), _
PlotBy:=xlColumns

I'm a network guy so VB is not my strong point.

Thank you for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default VB scripped works in Excel 2003 but fails in 2007


..Offset(0, -3) moves the range reference to the left by three columns.
If the TopLeftCell is in one of the first three columns then the code
will fail as you can't reference a location that is not on the sheet.

Also, budget some overtime, you will have more complaints about xl2007.
--
Jim Cone
Portland, Oregon USA




"DWad"
wrote in message
Our roll out of Office 2007 has been put on hold because our
engineering department has an excel spreadsheet in Excel 2003
they have used for years but fails in Excel 2007
The error is
Run-time error '-2147417848 (800 10 108)':
Method 'Offset' of object 'Range' failed

When I run debug after the failure this is the section of code that is high
lighted
.Chart.SetSourceData _
Source:=.TopLeftCell.Offset(0, -3).Resize(RepMeasurements, 2), _
PlotBy:=xlColumns

I'm a network guy so VB is not my strong point.
Thank you for any help.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default VB scripped works in Excel 2003 but fails in 2007

I tried to duplicate the error by running this code:

MsgBox Sheet1.Shapes("chart 2").TopLeftCell.Offset(0, -3).Address

but no problem. I'm not sure what your object was exactly since you didn't
post that part of your code.

Of course if the chart were too far left you'd get an error but that would
be true in Excel 2003 also. And the error would be different that what you
reported.

I had to tweak a lot of my code dealing with shapes to get it running in
Excel 2007.

--
Jim
"DWad" wrote in message
...
| Our roll out of Office 2007 has been put on hold because our engineering
| department has an excel spreadsheet in Excel 2003 they have used for years
| but fails in Excel 2007
|
| The error is
| Run-time error '-2147417848 (800 10 108)':
| Method 'Offset' of object 'Range' failed
|
| When I run debug after the failure this is the section of code that is
high
| lighted
| .Chart.SetSourceData _
| Source:=.TopLeftCell.Offset(0, -3).Resize(RepMeasurements, 2), _
| PlotBy:=xlColumns
|
| I'm a network guy so VB is not my strong point.
|
| Thank you for any help.

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
SUMIF formula works in Excel 2003, does not work in Excel 2007 Harry Excel Discussion (Misc queries) 3 April 24th 09 02:33 PM
function =IFERROR LOOKUP works in excel 2007 not in excel 2003 David Ryan Excel Worksheet Functions 4 April 15th 09 03:25 PM
xls file works fine in Excel 2000 and 2007 but crashes on opening in 2003 gromit12 Excel Discussion (Misc queries) 2 November 6th 07 09:30 PM
chart works in excel 2007, not 2003 [email protected] Excel Programming 2 August 27th 07 05:13 PM


All times are GMT +1. The time now is 03:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"