Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Tuesday and filedate

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Tuesday and filedate

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.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Ronel" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to calculate the next Tuesday Lee Perez Excel Discussion (Misc queries) 5 April 21st 23 02:53 PM
Tuesday JDay Excel Discussion (Misc queries) 1 February 3rd 10 09:58 PM
Every 1st, 3rd, 5th Tuesday Rick[_3_] Excel Worksheet Functions 9 June 12th 07 02:05 PM
12/31/2005 = TUESDAY? CLR Excel Discussion (Misc queries) 5 January 3rd 06 07:02 PM
How do I report the filedate in an Excel2000 cell? IaSwede Excel Worksheet Functions 1 March 3rd 05 02:08 PM


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"