Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default difficulty opening userform

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default difficulty opening userform

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default difficulty opening userform

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default difficulty opening userform

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" wrote in message
...
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
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
Difficulty opening files with Excel Sandy5590 Excel Discussion (Misc queries) 1 March 17th 10 06:56 AM
Out of Subscript error while opening a Userform shivboy[_10_] Excel Programming 6 June 22nd 06 12:07 PM
Userform opening mike Excel Programming 2 June 30th 05 06:17 PM
Opening Excel Application difficulty Ariston Excel Discussion (Misc queries) 1 February 20th 05 01:16 AM
Opening a UserForm kiat Excel Programming 0 August 19th 03 03:56 PM


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