Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2006, 01:58 PM
Authorized User
 
Join Date: Mar 2006
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


 
Old March 1st, 2006, 02:14 PM
Friend of Wrox
 
Join Date: Jun 2003
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

 
Old March 1st, 2006, 03:00 PM
Authorized User
 
Join Date: Mar 2006
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.






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





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