+ Reply to Thread
Results 1 to 3 of 3

Macros giving Run-time error '9' on all machines except mine

Hybrid View

  1. #1
    Registered User
    Join Date
    03-13-2005
    Posts
    29

    Macros giving Run-time error '9' on all machines except mine

    Hello, I have set up a central sheet with employee information in it and wrote macros in a few other sheets that pulls the information it needs from the central sheet. This allows me to enter the information once and then pull the information in as I need it.

    However, while the macro functions perfectly on my machine, it gives a Run-time error '9' error on any other machine I try to run it on. I have checked for Add-Ins and References and everything matches. The highlighted line is the one that the debugger highlights. My first thought was that the machine didn't have access to the file opened two lines above, but when I looked, the file had opened as was intended. I am at a loss to explain this. What am I missing?

    Thanks much in advance,
    Scott Tucker

    Private Sub cmdUpdate_Click()
    Dim ITT, CAD
        Application.ScreenUpdating = False
        Workbooks.Open Filename:="\\uberserver\SHARED\CallCenter\Sprint\Workforce\Central Agent Database.xls"
        Set ITT = ThisWorkbook.Sheets("AgentDB")
        Set CAD = Workbooks("Central Agent Database").Sheets("Agent Information")
        CAD.Columns("D:D").Copy
        ITT.Columns("A:A").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        CAD.Columns("C:C").Copy
        ITT.Columns("B:B").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        CAD.Columns("F:F").Copy
        ITT.Columns("C:C").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        ActiveWindow.Close
        ThisWorkbook.Activate
        Sheets("Invalid Transfers").Select
        Application.ScreenUpdating = True
    End Sub
    Last edited by VBA Noob; 07-17-2008 at 11:36 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello WinterCoast,

    Try this variation...
    Private Sub cmdUpdate_Click()
    Dim ITT, CAD
        Application.ScreenUpdating = False
        Set ITT = ThisWorkbook.Sheets("AgentDB")
        Workbooks.Open 
    Filename:="\\uberserver\SHARED\CallCenter\Sprint\Workforce\Central Agent Database.xls"
        Set CAD = ActiveWorkbook.Sheets("Agent Information")
        CAD.Columns("D:D").Copy
        ITT.Columns("A:A").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        CAD.Columns("C:C").Copy
        ITT.Columns("B:B").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        CAD.Columns("F:F").Copy
        ITT.Columns("C:C").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        ActiveWindow.Close
        ThisWorkbook.Activate
        Sheets("Invalid Transfers").Select
        Application.ScreenUpdating = True
    End Sub
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    03-13-2005
    Posts
    29
    Thank you! That has worked on all other computers I've tested. I really appreciate the help.

    Scott Tucker

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1