Hi all
I will start with saying i am very new to VB code and have taught myself everything so far and sorry if this is the wrong forum.
i have created a code that is ment to copy and paste data form a specific location to another this all works ok.
my problem is people at my work dont always get that the filename must always be the same so my code will see it.
I resolved this by making it bring up a error box to tell them what to do. all worked well on computer with win XP
but now on win7 OS it just gives me error 52 al the time unless the path actually exists
here is my code
Sub report433()
If Dir("E:\Todays data\[433] bag throughput.xls") = "" Then
MsgBox "file not found - make sure file is saved into- E:\todays data\ and file name is- [433] bag throughput", vbExclamation
Exit Sub
End If
Dim wbMyBook As Workbook
Set wbMyBook = ActiveWorkbook
Workbooks.Open ("E:\Todays data\[433] bag throughput.xls")
ActiveWorkbook.Sheets("sheet1").Range("A1:Z1000").Copy Destination:=wbMyBook.Sheets("433").Range("A1")
ActiveWorkbook.Close
End Sub


Reply With Quote


