Create shared file copy and start timer

jay_the_cob

New Member
Joined
May 23, 2018
Messages
7
Hello,

I read through the forum questions, but cannot find something specific enough to my issue. I am trying, from a template file, to have a vba button that will save a new shared copy with today's date and have a timer start for deadlines. My codes work up to the "ActiveWorkbook.SaveAs Filename" where I need to debug. I am quite a beginner with VBA so any help is appreciated.


Sub SaveDailyFile()

Dim Msg As String, Ans As Variant

Msg = "You are about to save a daily copy of this oversight dashboard. Do you wish to proceed?'"

Ans = MsgBox(Msg, vbYesNo)

Select Case Ans

Case vbYes

If Not FileFolder("\\Mflccg02\Cash Admin\Montreal\Jacob\Management\DAILY FILE" & Format(Date, "YYYY")) Then
MkDir ("\\Mflccg02\Cash Admin\Montreal\Jacob\Management\DAILY FILE" & Format(Date, "YYYY"))
End If

If Not FileFolder("\\Mflccg02\Cash Admin\Montreal\Jacob\Management\DAILY FILE" & Format(Date, "YYYY") & "" & Format(Date, "MMMM YYYY")) Then
MkDir ("\\Mflccg02\Cash Admin\Montreal\Jacob\Management\DAILY FILE" & Format(Date, "YYYY") & "" & Format(Date, "MMMM YYYY"))
End If

ActiveWorkbook.SaveAs Filename:= _
"\\Mflccg02\Cash Admin\Montreal\Jacob\Management\DAILY FILE" & Format(Now(), "YYYY") & "" & Format(Now(), "MMMM YYYY") & "\Oversight Report - " & Format(Now(), "MM.DD.YYYY") & ".xlsm" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False, AccessMode:=xlShared

Dim SchedRecalc As Date

With Sheet1.Range("G1")

.Value = Format(Time, "hh:mm:ss AM/PM")

End With

Call SetTime

SchedRecalc = Now + TimeValue("00:00:10")

Application.OnTime SchedRecalc, "Recalc"

Case vbNo
GoTo Quit:

End Select

Quit:

End Sub



Thanks,
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top