PC Review


Reply
Thread Tools Rate Thread

difficulty opening userform

 
 
=?Utf-8?B?Q01jSw==?=
Guest
Posts: n/a
 
      23rd Oct 2006
Hi,

My userform sources data from cells in a worksheet ("Projects"). However,
when the other worksheet in my workbook ("Timesheet") is the active
worksheet, the userform will not launch. Instead I get a run-time error:
'Select method of Range class failed'

Can someone please explain why this occurs.

Many thanks.

CMcK
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      23rd Oct 2006
If you have code in the sheet module for Projects and it is of the form

Range("A1").Select

if Projects is not the activesheet, this code will raise an error because it
is implicitly qualified as

worksheets("Projects").Range("A1").select

and since projects is not the activesheet, you get the error.

Change your code to

ActiveSheet.Range("A1").Select

possibly - it depends on what you are doing.

--
Regards,
Tom Ogilvy




"CMcK" wrote:

> Hi,
>
> My userform sources data from cells in a worksheet ("Projects"). However,
> when the other worksheet in my workbook ("Timesheet") is the active
> worksheet, the userform will not launch. Instead I get a run-time error:
> 'Select method of Range class failed'
>
> Can someone please explain why this occurs.
>
> Many thanks.
>
> CMcK

 
Reply With Quote
 
=?Utf-8?B?Q01jSw==?=
Guest
Posts: n/a
 
      23rd Oct 2006
Hi Tom,

I tried implementing the change you recommended and then running the
userform from the 'Timesheet' worksheet and the following error came up:

Run-time error 1004:
Application-defined or object-defined error

Any ideas?...

CMcK



"Tom Ogilvy" wrote:

> If you have code in the sheet module for Projects and it is of the form
>
> Range("A1").Select
>
> if Projects is not the activesheet, this code will raise an error because it
> is implicitly qualified as
>
> worksheets("Projects").Range("A1").select
>
> and since projects is not the activesheet, you get the error.
>
> Change your code to
>
> ActiveSheet.Range("A1").Select
>
> possibly - it depends on what you are doing.
>
> --
> Regards,
> Tom Ogilvy
>
>
>
>
> "CMcK" wrote:
>
> > Hi,
> >
> > My userform sources data from cells in a worksheet ("Projects"). However,
> > when the other worksheet in my workbook ("Timesheet") is the active
> > worksheet, the userform will not launch. Instead I get a run-time error:
> > 'Select method of Range class failed'
> >
> > Can someone please explain why this occurs.
> >
> > Many thanks.
> >
> > CMcK

 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      24th Oct 2006
> Any ideas?...

That you have something screwed up in your code. Beyond that, I would have
to be clairvoyant. If you used

Activesheet.Range("A1").Select

then I don't see how that would raise such an error unless Timesheet is a
chart sheet or you have something unusual selected. (make sure timesheet
is actually a worksheet and not a macro sheet or something).

--
Regards,
Tom Ogilvy

"CMcK" <(E-Mail Removed)> wrote in message
news:34D0D6D6-9A77-41CC-BE9C-(E-Mail Removed)...
> Hi Tom,
>
> I tried implementing the change you recommended and then running the
> userform from the 'Timesheet' worksheet and the following error came up:
>
> Run-time error 1004:
> Application-defined or object-defined error
>
> Any ideas?...
>
> CMcK
>
>
>
> "Tom Ogilvy" wrote:
>
>> If you have code in the sheet module for Projects and it is of the form
>>
>> Range("A1").Select
>>
>> if Projects is not the activesheet, this code will raise an error because
>> it
>> is implicitly qualified as
>>
>> worksheets("Projects").Range("A1").select
>>
>> and since projects is not the activesheet, you get the error.
>>
>> Change your code to
>>
>> ActiveSheet.Range("A1").Select
>>
>> possibly - it depends on what you are doing.
>>
>> --
>> Regards,
>> Tom Ogilvy
>>
>>
>>
>>
>> "CMcK" wrote:
>>
>> > Hi,
>> >
>> > My userform sources data from cells in a worksheet ("Projects").
>> > However,
>> > when the other worksheet in my workbook ("Timesheet") is the active
>> > worksheet, the userform will not launch. Instead I get a run-time
>> > error:
>> > 'Select method of Range class failed'
>> >
>> > Can someone please explain why this occurs.
>> >
>> > Many thanks.
>> >
>> > CMcK



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulty opening email Phyllis Windows Vista Mail 16 25th Jan 2010 11:53 PM
Difficulty Opening XL files =?Utf-8?B?QmlnZ2xlcw==?= Windows XP Help 3 25th Apr 2007 02:34 AM
Difficulty opening IE =?Utf-8?B?U3V6ZzI3?= Windows XP Internet Explorer 1 11th Mar 2005 10:17 PM
difficulty opening attachments mel Microsoft Outlook Discussion 1 1st Jul 2004 03:17 AM
Difficulty Opening Links HowdyF Windows XP General 0 9th Jan 2004 07:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:29 AM.