Ray Bailey
New Member
- Joined
- Nov 12, 2015
- Messages
- 34
Hi,
First thread so sorry if I don't put my query over fully.
I need a method of recognising when a file is opened so I can then automatically save it to disk.
Reason for this is that I recieve files via email hyperlinks each day which I open and then have to save via Save As options. This might sound like I'm being a bit lazy but the file name is always AUTO.xls and I get around 30 a day. The name of Sheet 1 can be used to denote the name of the output file.
Can't use code in Outlook as the hyper link is actually to a .app file on the webserver.
The following code works fine I just don't know how to automatically trigger this. I presume it needs to be in my Personal.xls file somewhere.
Sub Auto_Save()
Dim sFileNm As String
If Worksheets(1).Name = "DailyPlacementSummar" Then
sFileNm = "C:\Daily Placements " & Format(Date, "dd mm yy") & ".xlsx"
ActiveWorkbook.SaveAs FileName:=sFileNm, Password:="pw1"
ActiveWorkbook.Close
End If
End Sub
Any help will be gratefully received.
Cheers Ray
First thread so sorry if I don't put my query over fully.
I need a method of recognising when a file is opened so I can then automatically save it to disk.
Reason for this is that I recieve files via email hyperlinks each day which I open and then have to save via Save As options. This might sound like I'm being a bit lazy but the file name is always AUTO.xls and I get around 30 a day. The name of Sheet 1 can be used to denote the name of the output file.
Can't use code in Outlook as the hyper link is actually to a .app file on the webserver.
The following code works fine I just don't know how to automatically trigger this. I presume it needs to be in my Personal.xls file somewhere.
Sub Auto_Save()
Dim sFileNm As String
If Worksheets(1).Name = "DailyPlacementSummar" Then
sFileNm = "C:\Daily Placements " & Format(Date, "dd mm yy") & ".xlsx"
ActiveWorkbook.SaveAs FileName:=sFileNm, Password:="pw1"
ActiveWorkbook.Close
End If
End Sub
Any help will be gratefully received.
Cheers Ray