How to Save on a Network Drive using UNC?

  • Thread starter Thread starter Scooby912
  • Start date Start date
S

Scooby912

Hi all,

I am trying to save a file onto a network drive. My problem is, several
different departments have different drive mappings. We all have different
drive letters for our shared directory, so I can't use my current
procedures...

Private Sub CommandButton_Click()
ChDrive "C"
ChDir "C:\Dir"
ActiveWorkbook.SaveAs "filename" & Format(Now, "mmddyy_hhmmss") &
".xls"
End Sub

Instead of using ChDrive "C" and ChDir "C:\Dir" can I use it's UNC
equivalent? and how do I do it?

Thanks,
Erwin
 
Hi Erwin,

There's no need to change the current directory to save a workbook to a
specific location. You could save it to a UNC share like this:

ActiveWorkbook.SaveAs "\\Server\ShareName\Book1.xls"

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

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Back
Top