Saving a file

  • Thread starter Thread starter Alastair MacFarlane
  • Start date Start date
A

Alastair MacFarlane

Dear All,

Programtically a Workbook is opened as read only from a
shared directory. How can I enure that when a user tries
to press save, the directory where the file was opened is
not the directory that Excel tries to save the file, but
one of my choice?

Chdir does not work. I could customise the Excel Workbook
or make the shared directory read only, but is there an
easier way?

Alastair
 
Alastair MacFarlane said:
Programtically a Workbook is opened as read only from a
shared directory. How can I enure that when a user tries
to press save, the directory where the file was opened is
not the directory that Excel tries to save the file, but
one of my choice?

Chdir does not work. I could customise the Excel Workbook
or make the shared directory read only, but is there an
easier way?

Hi Alastair,

Modifying the workbook or making the directory read-only are your only
options. Can you explain exactly what you mean by "ChDir does not work." If
you are trying to change the current directory to a different drive then you
must use ChDrive first to change the drive before using ChDir to change the
directory. I think the best place to put the code required to change the
current directory before the workbook is saved would be the
Workbook_BeforeClose event procedure.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm
 
Rob,

Thanks for your quick reply. Your comments were much as I
had expected, although I didn't know that ChDrive had to
proceed Chdir to achieve the results I wanted to achieve.
I think my best option is to change the code of the save
toolbar and File, Save/Save As to change the drive and
diectory.

Once again thanks again...

Alastair
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top