Since workbooks are on a network server, perhaps you could Use UNC (Universal Naming Convention) and not be concerned with each user's drive mapping, you address the server by name.
Example (Fritz is the server name):
CODE
Dim oExcel As Excel.Application
Dim oBook As Excel.Workbook
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Open("\\Fritz\Admin\STWMAT\Central Region Materials\PAVEMENT MANAGEMENT\airports\Report Production\AASP.xlsx")
I don't see why you need the Activate code. I have never used it. Also, don't have to Select or Activate sheets or cells to manipulate them. Address sheets by name or index, cells by reference. The cell cursor never moves.
Copy/Paste example
CODE
Worksheets("Sheet1").Range("A1").Copy
Worksheets("Sheet1").Paste Destination:=Worksheets("Sheet1").Range("B1")
Application.CutCopyMode = False
Careful, if cells have formulas with relative referencing, the formulas will be copied but referenced cells will be adjusted, absolute referencing will not.
Should not have to open/close the workbook for each worksheet copy/paste. Use loop structure, something like:
CODE
' Declare Current as a worksheet object variable.
Dim Current As Worksheet
' Loop through all of the worksheets in the active workbook.
For Each Current In Worksheets
' Insert your code here.
Next
If you don't want to address every worksheet, refer to only those sheets that are index 1 through 5, in a For Next loop. Depending on your workbook structure, there may be other ways to identify the sheets you want to address.
This post has been edited by June7: 2 Nov, 2009 - 04:21 PM