How To Save File With User Enter path with Input BOX

AT BABU

Board Regular
Joined
Oct 12, 2018
Messages
53
Office Version
2016
Platform
Windows
Hello Every one


Dim T as Variant
T = InputBox("Enter Your CORP ID")

ChDir "\\Client\C$\Users\T\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"\\Client\C$\Users\T\Desktop\From Application to MIS_V.0.1.xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False

I have above code but code notrun , I get Run Time Error 76 Path not found
 
Last edited by a moderator:

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Grand

Board Regular
Joined
May 11, 2017
Messages
52
A way to get the path of the file is to place a file in that directory and then right click on it, then click "properties". Under location you can see the path. Check if that is the same.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,669
Office Version
365
Platform
Windows
Hi & welcome to MrExcel
Try
Code:
Dim T As Variant
Dim Pth As String
T = InputBox("Enter Your CORP ID")
Pth = "\\Client\C$\Users\" & T & "\Desktop\"

ActiveWorkbook.SaveAs filename:= _
Pth & "From Application to MIS_V.0.1.xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
 
Last edited:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,669
Office Version
365
Platform
Windows
You're welcome
 

Watch MrExcel Video

Forum statistics

Threads
1,102,363
Messages
5,486,404
Members
407,547
Latest member
Sankarasrinivas

This Week's Hot Topics

Top