Tuesday and filedate

R

Ronel

I have a file and want it saved onto a server if it is opened on a Tuesday.
I have written code and it works perfectly on my machine, but when I put the
file onto 150 users' machines, the code does not run at all.
Public ronel, mydate As Date
Public inside, x As String


Private Sub workbook_open()
mydate = Worksheets("RBEU Input").Range("il2").Value
inside = Weekday(mydate)
ronel = FileDateTime("C:\Documents and Settings\abrl128\Desktop\Workflow
Input.xls")
x = Weekday(ronel)

If (inside = 3 And (x < 3 Or x > 3)) Then
Application.DisplayAlerts = False
ChDir "\\10.6.40.77\Shared Files\Workflow\Input\"
ActiveWorkbook.SaveAs Filename:="\\10.6.40.77\Shared
Files\Workflow\Input\Input_abrl128.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, _
CreateBackup:=False

ChDir "C:\Documents and Settings\abrl128\Desktop\"
ActiveWorkbook.SaveAs Filename:="C:\Documents and
Settings\abrl128\Desktop\Workflow Input.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, _
CreateBackup:=False
Application.DisplayAlerts = True
End If
End Sub



When I open the file on my machine, it saves to the server. When the user
opens the file on his machine, nothing happens and the file lets him work on
it and save and go crazy, like it should, but I dont see a copy of his file
on my server. I am frustrated and dont know why it does this. The user has
his own copy of the file on his own machine....WHAT AM I GOING TO DO?
 
J

John Bundy

Not totally sure but this looks fishy to me
C:\Documents and Settings\abrl128\Desktop\Workflow
Input.xls")

looks like you are setting the file at a static location, this will only
work if the file is in the same place on everyones drive. Check on
activeworkbook.path. I may be off target without being able to run it but
that piece is the only one i see that could cause errors on all machines but
the one it was built on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top