Saving to a Network Path using VBA

  • Thread starter Thread starter Mike R
  • Start date Start date
M

Mike R

Hi Guys,

I may be asking a bit much with this! but any guidance is
very much appreciated.

I have recently written an add-in that will be used very
frequently. What I would like to do is make the user
enter a job number in a an input box on opening the add-in
file, and then for this file to be saved to a
predetermined network path with the entered number i.e.
J:\addin\"jobnumber.xls".

Is this possible?

Thanks for your help in advance


Michael
 
Try this

Sub test()
Dim mynum As Long
Dim yoursavestring As String
mynum = Application.InputBox("Enter a number", Type:=1)
yoursavestring = "J:\addin\jobnumber" & mynum & ".xls"
ActiveWorkbook.SaveAs yoursavestring
End Sub

you must also check if the file not exist
 
Back
Top