Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error '1004' - the specified value is out of range.

Could someone please enlighten me as to why I get a runtime error from this
line of code. It was generated by Excel 2003 itself using the 'record macro'
command from the 'tools menu'. I selected 'record', then the rectangle shape
from the drawing tools menu, then dragged my cursor in the upper left corner
of my worksheet to the approx. size rectangle I wanted, then stopped
recording. When I try to run the macro, I get "Runtime error '1004' - the
specified value is out of range." I appreciate any response.

I
Sub Macro1()
'
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 18#, 18#, 108#, 41.25). _
Select
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Error '1004' - the specified value is out of range.

Don, thanks for checking it out. Did xl2002 generate the same line of code
during the record process? This is absolutely maddening to me because I
can't get the macro to run for making rectangles or ovals in xl2003. Are
there any xl2003 users out there who could try the record process.

"Don Guillett" wrote:

I just tested this in a regular module in xl2002 and it worked fine.

--
Don Guillett
SalesAid Software

"Chris" <Chris wrote in message
...
Could someone please enlighten me as to why I get a runtime error from

this
line of code. It was generated by Excel 2003 itself using the 'record

macro'
command from the 'tools menu'. I selected 'record', then the rectangle

shape
from the drawing tools menu, then dragged my cursor in the upper left

corner
of my worksheet to the approx. size rectangle I wanted, then stopped
recording. When I try to run the macro, I get "Runtime error '1004' - the
specified value is out of range." I appreciate any response.

I
Sub Macro1()
'
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 18#, 18#, 108#, 41.25). _
Select
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Error '1004' - the specified value is out of range.

Chris,

This is what I record in XL 03. It works when I run it:

ActiveSheet.Shapes.AddShape(msoShapeRectangle, 46.5, 43.5, 316.5, 240#).
_
Select

I also ran your exact code and it worked.

Doug

"Chris S." wrote in message
...
Don, thanks for checking it out. Did xl2002 generate the same line of

code
during the record process? This is absolutely maddening to me because I
can't get the macro to run for making rectangles or ovals in xl2003. Are
there any xl2003 users out there who could try the record process.

"Don Guillett" wrote:

I just tested this in a regular module in xl2002 and it worked fine.

--
Don Guillett
SalesAid Software

"Chris" <Chris wrote in message
...
Could someone please enlighten me as to why I get a runtime error from

this
line of code. It was generated by Excel 2003 itself using the 'record

macro'
command from the 'tools menu'. I selected 'record', then the

rectangle
shape
from the drawing tools menu, then dragged my cursor in the upper left

corner
of my worksheet to the approx. size rectangle I wanted, then stopped
recording. When I try to run the macro, I get "Runtime error '1004' -

the
specified value is out of range." I appreciate any response.

I
Sub Macro1()
'
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 18#, 18#, 108#,

41.25). _
Select
End Sub






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Error '1004' - the specified value is out of range.

Doug, thanks for checkiing it in xl03. After reading your results and
everyone elses, I went back and tried and failed again (something has to be
wrong). Then I tried it in a new xl '03 workbook and it worked fine. All I
can figure is that there was something incompatible in the workbook I was
originally trying it in. It was an old workbook that had its origin in xl
'95 but had been saved to newer formats as my xl was upgraded. It had been
working fine with other '03 features till this little quirk appeared.

Thanks to all.

"Doug Glancy" wrote:

Chris,

This is what I record in XL 03. It works when I run it:

ActiveSheet.Shapes.AddShape(msoShapeRectangle, 46.5, 43.5, 316.5, 240#).
_
Select

I also ran your exact code and it worked.

Doug

"Chris S." wrote in message
...
Don, thanks for checking it out. Did xl2002 generate the same line of

code
during the record process? This is absolutely maddening to me because I
can't get the macro to run for making rectangles or ovals in xl2003. Are
there any xl2003 users out there who could try the record process.

"Don Guillett" wrote:

I just tested this in a regular module in xl2002 and it worked fine.

--
Don Guillett
SalesAid Software

"Chris" <Chris wrote in message
...
Could someone please enlighten me as to why I get a runtime error from
this
line of code. It was generated by Excel 2003 itself using the 'record
macro'
command from the 'tools menu'. I selected 'record', then the

rectangle
shape
from the drawing tools menu, then dragged my cursor in the upper left
corner
of my worksheet to the approx. size rectangle I wanted, then stopped
recording. When I try to run the macro, I get "Runtime error '1004' -

the
specified value is out of range." I appreciate any response.

I
Sub Macro1()
'
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 18#, 18#, 108#,

41.25). _
Select
End Sub









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Error '1004' - the specified value is out of range.

I can get that error if I don't have a valid constant value in the first
argument. I would suggest you edited the macro and (inadvertently) changed
the first argument from something other than msoShapeRectangle or you
redefined the value of msoShapeRectangle.

--
Regards,
Tom Ogilvy


"Chris S." wrote in message
...
Doug, thanks for checkiing it in xl03. After reading your results and
everyone elses, I went back and tried and failed again (something has to

be
wrong). Then I tried it in a new xl '03 workbook and it worked fine. All

I
can figure is that there was something incompatible in the workbook I was
originally trying it in. It was an old workbook that had its origin in xl
'95 but had been saved to newer formats as my xl was upgraded. It had

been
working fine with other '03 features till this little quirk appeared.

Thanks to all.

"Doug Glancy" wrote:

Chris,

This is what I record in XL 03. It works when I run it:

ActiveSheet.Shapes.AddShape(msoShapeRectangle, 46.5, 43.5, 316.5,

240#).
_
Select

I also ran your exact code and it worked.

Doug

"Chris S." wrote in message
...
Don, thanks for checking it out. Did xl2002 generate the same line of

code
during the record process? This is absolutely maddening to me because

I
can't get the macro to run for making rectangles or ovals in xl2003.

Are
there any xl2003 users out there who could try the record process.

"Don Guillett" wrote:

I just tested this in a regular module in xl2002 and it worked fine.

--
Don Guillett
SalesAid Software

"Chris" <Chris wrote in message
...
Could someone please enlighten me as to why I get a runtime error

from
this
line of code. It was generated by Excel 2003 itself using the

'record
macro'
command from the 'tools menu'. I selected 'record', then the

rectangle
shape
from the drawing tools menu, then dragged my cursor in the upper

left
corner
of my worksheet to the approx. size rectangle I wanted, then

stopped
recording. When I try to run the macro, I get "Runtime error

'1004' -
the
specified value is out of range." I appreciate any response.

I
Sub Macro1()
'
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 18#, 18#, 108#,

41.25). _
Select
End Sub









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Error '1004' - the specified value is out of range.

I have xl95,xl97 and xl2002. So, I went to xl95 and created a workbook. I
then went to xl2002 and added the macro
sub dd
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 46.5, 43.5, 316.5,
240#).Select
end sub
and it worked fine in a regular module, in a sheet module and in
ThisWorkbook.
Corruption???


--
Don Guillett
SalesAid Software

"Doug Glancy" wrote in message
...
Chris,

This is what I record in XL 03. It works when I run it:

ActiveSheet.Shapes.AddShape(msoShapeRectangle, 46.5, 43.5, 316.5,

240#).
_
Select

I also ran your exact code and it worked.

Doug

"Chris S." wrote in message
...
Don, thanks for checking it out. Did xl2002 generate the same line of

code
during the record process? This is absolutely maddening to me because I
can't get the macro to run for making rectangles or ovals in xl2003.

Are
there any xl2003 users out there who could try the record process.

"Don Guillett" wrote:

I just tested this in a regular module in xl2002 and it worked fine.

--
Don Guillett
SalesAid Software

"Chris" <Chris wrote in message
...
Could someone please enlighten me as to why I get a runtime error

from
this
line of code. It was generated by Excel 2003 itself using the

'record
macro'
command from the 'tools menu'. I selected 'record', then the

rectangle
shape
from the drawing tools menu, then dragged my cursor in the upper

left
corner
of my worksheet to the approx. size rectangle I wanted, then stopped
recording. When I try to run the macro, I get "Runtime error

'1004' -
the
specified value is out of range." I appreciate any response.

I
Sub Macro1()
'
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 18#, 18#, 108#,

41.25). _
Select
End Sub








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Error '1004' - the specified value is out of range.

This is baffling to me that I can't get it to work in my original workbook.
Tom Ogilvy suggested that I may have inadvertently changed the constant
'msoShapeRectangle' , but that is not the case because I try running the
macro right after stopping the 'record macro' process and then get the
runtime error. I get the same error when I record making an oval.

When I go through the same exact record process in a new xl 03 workbook, the
macros work fine.

When I compare the code from the two workbooks, it is absolutely identical.

If I copy the working macro from the new workbook into my original, I get
the runtime error. What gives?

Thanks for checking into it.

"Don Guillett" wrote:

I have xl95,xl97 and xl2002. So, I went to xl95 and created a workbook. I
then went to xl2002 and added the macro
sub dd
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 46.5, 43.5, 316.5,
240#).Select
end sub
and it worked fine in a regular module, in a sheet module and in
ThisWorkbook.
Corruption???


--
Don Guillett
SalesAid Software

"Doug Glancy" wrote in message
...
Chris,

This is what I record in XL 03. It works when I run it:

ActiveSheet.Shapes.AddShape(msoShapeRectangle, 46.5, 43.5, 316.5,

240#).
_
Select

I also ran your exact code and it worked.

Doug

"Chris S." wrote in message
...
Don, thanks for checking it out. Did xl2002 generate the same line of

code
during the record process? This is absolutely maddening to me because I
can't get the macro to run for making rectangles or ovals in xl2003.

Are
there any xl2003 users out there who could try the record process.

"Don Guillett" wrote:

I just tested this in a regular module in xl2002 and it worked fine.

--
Don Guillett
SalesAid Software

"Chris" <Chris wrote in message
...
Could someone please enlighten me as to why I get a runtime error

from
this
line of code. It was generated by Excel 2003 itself using the

'record
macro'
command from the 'tools menu'. I selected 'record', then the

rectangle
shape
from the drawing tools menu, then dragged my cursor in the upper

left
corner
of my worksheet to the approx. size rectangle I wanted, then stopped
recording. When I try to run the macro, I get "Runtime error

'1004' -
the
specified value is out of range." I appreciate any response.

I
Sub Macro1()
'
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 18#, 18#, 108#,

41.25). _
Select
End Sub









  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Error '1004' - the specified value is out of range.

Works fine in xl2000

"Chris" wrote:

Could someone please enlighten me as to why I get a runtime error from this
line of code. It was generated by Excel 2003 itself using the 'record macro'
command from the 'tools menu'. I selected 'record', then the rectangle shape
from the drawing tools menu, then dragged my cursor in the upper left corner
of my worksheet to the approx. size rectangle I wanted, then stopped
recording. When I try to run the macro, I get "Runtime error '1004' - the
specified value is out of range." I appreciate any response.

I
Sub Macro1()
'
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 18#, 18#, 108#, 41.25). _
Select
End Sub

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error '1004' - the specified value is out of range.

I've experienced the same difficulties and having followed the thead of
postings here, I have found them to be EXTEMELY helpful. Thank you all for
your contributions!!

"Jim Thomlinson" wrote:

Works fine in xl2000

"Chris" wrote:

Could someone please enlighten me as to why I get a runtime error from this
line of code. It was generated by Excel 2003 itself using the 'record macro'
command from the 'tools menu'. I selected 'record', then the rectangle shape
from the drawing tools menu, then dragged my cursor in the upper left corner
of my worksheet to the approx. size rectangle I wanted, then stopped
recording. When I try to run the macro, I get "Runtime error '1004' - the
specified value is out of range." I appreciate any response.

I
Sub Macro1()
'
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 18#, 18#, 108#, 41.25). _
Select
End Sub



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error '1004' - the specified value is out of range.

This has just solved a problem that I have spent two solid days trying
to resolve.

Many thanks!



*** Sent via Developersdex http://www.developersdex.com ***
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
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
Set worksheet range runtime error 1004 DaveP Excel Programming 1 March 29th 05 07:13 AM
1004 error when selecting a range Matt J[_2_] Excel Programming 9 July 3rd 04 10:05 PM
Error 1004 when selecting a range Matt J Excel Programming 1 July 3rd 04 06:50 PM
Range.Copy and error 1004 Carl Rapson Excel Programming 5 November 15th 03 03:21 AM


All times are GMT +1. The time now is 04:44 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"