Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default R/T error - 424 - Why?

My code down to the problem...

Sub Foo()
Dim lrow As Long
Dim numhpb As Long
Dim lrprint As Long
Dim LPage As Long
Dim i As Integer
Dim STRng As Range
Application.EnableEvents = False
Set STRng = Application.InputBox("Highlight the Range of Amts to be
Subtotaled", Type:=8) <<<< error here !! (this statement is on one line)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default R/T error - 424 - Why?

The SET statement (SET STRng = ...) is to set an object variable equal to
another object of the same type (or to NOTHING). Just use plain "=" here.
--
- K Dales


"Jim May" wrote:

My code down to the problem...

Sub Foo()
Dim lrow As Long
Dim numhpb As Long
Dim lrprint As Long
Dim LPage As Long
Dim i As Integer
Dim STRng As Range
Application.EnableEvents = False
Set STRng = Application.InputBox("Highlight the Range of Amts to be
Subtotaled", Type:=8) <<<< error here !! (this statement is on one line)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default R/T error - 424 - Why?

Should have also looked at the context of what you are doing, sorry!
Actually your code works fine on my machine as written. However, the 424
error implies that it does not recognize the either STRng or the InputBox
result as an object. I am also baffled.

--
- K Dales


"K Dales" wrote:

The SET statement (SET STRng = ...) is to set an object variable equal to
another object of the same type (or to NOTHING). Just use plain "=" here.
--
- K Dales


"Jim May" wrote:

My code down to the problem...

Sub Foo()
Dim lrow As Long
Dim numhpb As Long
Dim lrprint As Long
Dim LPage As Long
Dim i As Integer
Dim STRng As Range
Application.EnableEvents = False
Set STRng = Application.InputBox("Highlight the Range of Amts to be
Subtotaled", Type:=8) <<<< error here !! (this statement is on one line)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default R/T error - 424 - Why?

If the user hits cancel, you'll get that error.

You may want to try:

set strng = nothing
on error resume next
set strng = application.inputbox(...., type:=8)
on error goto 0

if strng is nothing then
'user hit cancel
else
'do the work
end if

==========
And something from Ron de Bruin and Jan Karel Pieterse that could be your
problem:
http://www.jkp-ads.com/Articles/SelectARange.asp

Jim May wrote:

My code down to the problem...

Sub Foo()
Dim lrow As Long
Dim numhpb As Long
Dim lrprint As Long
Dim LPage As Long
Dim i As Integer
Dim STRng As Range
Application.EnableEvents = False
Set STRng = Application.InputBox("Highlight the Range of Amts to be
Subtotaled", Type:=8) <<<< error here !! (this statement is on one line)


--

Dave Peterson
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
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Form Err.Raise error not trapped by entry procedure error handler [email protected] Excel Programming 1 February 8th 06 10:19 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


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