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: 661
Default Strange error if another Excel book is opened

A bullet-proof application has been running for 5 years. I made a few small
changes and tested them. Everything worked perfect.

Now the weird part. The code works fine if the workbook is the <only
workbook open. If I open a second, unrelated workbook, EVEN A BLANK BOOK ONE
WITH NO MACROS, I get a "Subscript out of range" error. Why why why???

I should note that the code contains no Declare or Dim statements because
all my variables are used only within the module.

Any help is appreciated.

Paul

Here is the code:

Sub Findstore()

ActiveWindow.WindowState = xlMinimized

SHTNAME = ActiveSheet.Name

AAAA = Activecell.Value 'example of typical value: "555 New York"

'Below line is where the error occurs
Sheets("VAR1").Range("M8").Value = AAAA

If AAAA = "" Then AAAA = Range("C5").Value


 
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
EXCEL WORK BOOK DUPLICATES WHEN OPENED Asoka Walpitagama - Brandix College IT Excel Discussion (Misc queries) 1 November 18th 09 02:25 PM
Auto sort when worksheet/book opened Lise Excel Discussion (Misc queries) 4 October 26th 08 12:35 AM
Strange Excel error D23 Excel Discussion (Misc queries) 3 August 17th 07 09:01 PM
Strange Calculation Error in Excel 0-0 Wai Wai ^-^ Excel Discussion (Misc queries) 15 December 12th 05 11:30 AM
how to make a macro and run in every excel book that opened? wayan Excel Programming 3 February 22nd 05 08:47 AM


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