Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi folks,
Is there a way to open an excell file so that when you go to save it it saves in a specific directory? ps I am opening this file using the hyperlink function within excel. thanks Dave |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave, do you want to save the file in the same directory it was opened
from or to a standard, default directory or to a directory that the user chooses? Alan David Hodgson wrote: Hi folks, Is there a way to open an excell file so that when you go to save it it saves in a specific directory? ps I am opening this file using the hyperlink function within excel. thanks Dave |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi alan,
If the hyperlink points to c:\folderA\test.xls, I want excel to save it in c:\folderB\test.xls. But I only want this to happen for test.xls. Dave Alan wrote: Dave, do you want to save the file in the same directory it was opened from or to a standard, default directory or to a directory that the user chooses? Alan David Hodgson wrote: Hi folks, Is there a way to open an excell file so that when you go to save it it saves in a specific directory? ps I am opening this file using the hyperlink function within excel. thanks Dave |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Trap the BeforeSave event and write it to your specified directory
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Cancel = True Application.DisplayAlerts = False ThisWorkbook.SaveAs "C:\myDir\" & ThisWorkbook.Name Application.DisplayAlerts = True End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "David Hodgson" wrote in message ps.com... Hi folks, Is there a way to open an excell file so that when you go to save it it saves in a specific directory? ps I am opening this file using the hyperlink function within excel. thanks Dave |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave, the only thing that you may want to add to Bob's code is a test
that you are saving "test.xls" and not another file. Hence ... Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Cancel = True If ThisWorkbook.Name = "test.xls" Then Application.DisplayAlerts = False ThisWorkbook.SaveAs "C:\myDir\" & ThisWorkbook.Name Application.DisplayAlerts = True End If End Sub Bob Phillips wrote: Trap the BeforeSave event and write it to your specified directory Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Cancel = True Application.DisplayAlerts = False ThisWorkbook.SaveAs "C:\myDir\" & ThisWorkbook.Name Application.DisplayAlerts = True End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "David Hodgson" wrote in message ps.com... Hi folks, Is there a way to open an excell file so that when you go to save it it saves in a specific directory? ps I am opening this file using the hyperlink function within excel. thanks Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Saving to root directory | Excel Discussion (Misc queries) | |||
Saving file to specific directory | Excel Programming | |||
Saving into new directory | Excel Discussion (Misc queries) | |||
saving/creating a directory | Excel Programming | |||
Saving to same directory | Excel Programming |