LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet Codename - Crazy Method Error!


Hello All -

I'm a VBA beginner, and new to the boards. I've written a program in
VBA (Excel) and everything is going well...except one thing, even after
searching all over the place.
I refer to my worksheets by their codename ( as a good practice).
Excel gives me a 1004 error, "Application-defined or object-defind
error" on both of these these lines (not together in the code):

shInput.Cells(15, 2).Offset(0, varEnabledCount).Select

varNumber = shInput.Cells(18, varActiveCellCol).Value

where shInput is a sheet codename in the workbook where the module
resides, and I already used ThisWorkbook.Activate. However, this line
of code works juuust fine:

shInput.Cells(65,2).Value = 777

Furthermore, they -all- work if I have the shInput sheet activated
before I run the procedure! Why won't they work if I am looking at any
sheet while executing the procedure? Am I nuts? Is VBA broken? Am I
missing something very simple? (I really hope it's the last one).

::kicks Excel::

Thanks in advance!


--
EphesiansSix
------------------------------------------------------------------------
EphesiansSix's Profile: http://www.excelforum.com/member.php...o&userid=35721
View this thread: http://www.excelforum.com/showthread...hreadid=555046

 
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
? Get Worksheet Codename List gabch[_10_] Excel Programming 1 April 11th 06 12:33 PM
Calling a worksheet via a codename Thierry Paradis Excel Programming 2 March 2nd 06 02:41 PM
Using Worksheet Codename to Determine Worksheet Existence David Copp[_3_] Excel Programming 4 July 2nd 04 08:00 AM
Paste method of worksheet class failed error Todd Huttenstine[_2_] Excel Programming 1 December 16th 03 10:08 AM
Worksheet codename Andy Excel Programming 4 December 2nd 03 04:12 PM


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