define savinglocation for 1 file

A

Arien

I have made a workgroup-template for a complaint form.

Several people will use this form and save it on the intranet.

I want this form to be saved all in the same location without having to
select this location everytime.

How can I set this location automaticly for this template only.

Thanks for your help.
Arien
 
B

Bernie Deitrick

Arien,

In the Thisworkbook object's codemodule, you could use code like this
to cancel the user's save and perform your own:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Cancel = True
Application.EnableEvents = False
ThisWorkbook.SaveAs "C:\Excel\FileName" & Format(Now(), "mm-dd-yyy
hh-mm")
Application.EnableEvents = False
End Sub

Change the file path and default name as needed.

HTH,
Bernie
MS Excel MVP
 
B

Bernie Deitrick

Oops, a cut and paste mistake. That second
Application.EnableEvents = False
should be
Application.EnableEvents = True

Sorry about that,
Bernie
MS Excel MVP

Bernie Deitrick said:
Arien,

In the Thisworkbook object's codemodule, you could use code like this
to cancel the user's save and perform your own:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Cancel = True
Application.EnableEvents = False
ThisWorkbook.SaveAs "C:\Excel\FileName" & Format(Now(), "mm-dd-yyy
hh-mm")
Application.EnableEvents = False
End Sub

Change the file path and default name as needed.

HTH,
Bernie
MS Excel MVP

Arien said:
I have made a workgroup-template for a complaint form.

Several people will use this form and save it on the intranet.

I want this form to be saved all in the same location without
having
 
Top