Corrected question. Input box to allow user to change The path: where Worksheet is saved

Paulo H

Board Regular
Joined
Jun 10, 2020
Messages
106
Office Version
  1. 2016
Platform
  1. Windows
Hi

I have a sheet that is used by colleagues and has a module that saves the sheet to a set path By clicking on button for each person but to do that I have to change/add manually their Save path, then resend them a new template Each. I do not want to give Them access to the code

So i am trying to workout away of creating an input box(maybe via macro) that each user can use the master template and via input box enter their path to reset the path line to theirs, then they can Resave the template for each user.

ie open input box write in it their path where to save eg. C:\xxx\xxx the when they click ok it changes the path line in the code. Once this has been done they can save the sheet template and it keeps the new path line for them.

The Code is


the line I want to change via input box is underlined

Private Sub Saveonly_Click()

Dim dlgFile As FileDialog

Dim I As Integer

Dim ext As String

Dim fileName As String



Set dlgFile = Application.FileDialog(msoFileDialogSaveAs)

ext = "*."

fileName = "MyFileNameHere"

For I = 1 To dlgFile.Filters.Count

If dlgFile.Filters(I).Extensions = "*.xlsm" Then

dlgFile.FilterIndex = I

Exit For

End If

Next

With dlgFile

.InitialFileName = "C:\Users\freddy\OneDrive - Myshop Limited\Quote 2020\" & Range("B8").Value & " " & Range("B1").Value & " " & Range("C1").Value

If .Show = 0 Then

MsgBox "Quotation not saved!.", vbCritical

Exit Sub

End If

.Execute

End With

Tools.Hide

End Sub


thanks
 
Last edited by a moderator:

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,215,065
Messages
6,122,944
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top