Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 1st, 2006, 01:58 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Subscript error...but only on my PC

I am trying to run the following script:

Public Sub ContactCenterSummary()

Application.ScreenUpdating = False
monthlyupdatevariable = False

            DefineIterations

   Do While iterations > 0
            FindCurrentDay
                    iterations = iterations - 1
                    filetest = False
            CheckFiles
                    If filetest = True Then
                    Exit Sub
                    End If

            OpenAndCopyFiles


Workbooks("CC Summary Report").Worksheets("Summary").Range("e3") = lastupdated + 1

   Loop

            UpdatePivotTables
            ResizeColumns
            SaveCCSummary


Application.ScreenUpdating = True

End Sub

This script starts a chain of events...However when I execute the script I get Run-time error '9': Subscript out of range error. Any idea what I may need to fix this? TIA


Reply With Quote
  #2 (permalink)  
Old March 1st, 2006, 02:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: London, , United Kingdom.
Posts: 173
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Its hard to say but you've most likely got a typo in the line
Code:
Workbooks("CC Summary Report").Worksheets("Summary").Range("e3") = lastupdated + 1
Are the workbook and worksheet spelt absolutely correctly? Is the workbook in question open in the same instance of Excel?

It might help if you indicate which line the code debugs out on if this does not solve it.

Maccas

Reply With Quote
  #3 (permalink)  
Old March 1st, 2006, 03:00 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The entire program runs on all PCs but my own. If I go to a different desk, open the same file, I can run the program w/ no error. It fails at:

Do While iterations > 0
            FindCurrentDay
                    iterations = iterations - 1
                    filetest = False

using debug to see that. I thought it might be some option I may not have checked in a feature or something. Thanks for the input.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VC++ 2005 PC ERROR @ PC STARTUP -JUST IN TIME DBUG CPPGUY Visual C++ 2005 0 October 3rd, 2008 12:52 PM
question on subscript out of range error? kwik10z Excel VBA 1 November 30th, 2007 10:14 PM
Error 3011 after installation to another pc bluebear VB How-To 1 February 26th, 2007 10:59 AM
subscript error with a formula wallace Crystal Reports 0 February 6th, 2007 05:39 PM
Subscript out of range rfrancisco Classic ASP Components 1 February 13th, 2006 08:25 PM



All times are GMT -4. The time now is 01:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.