automatically enter text into input box

smichael

New Member
Joined
Jul 15, 2011
Messages
38
Hello all,
I have a code that requires a user to enter a text before saving the file in order to protect changes to this. The code runs well in protecting the original document, but I also have a macro that would automatically save the file location to something else, which now prompts the inputbox.

My question is: Is there a way to automatically enter the password (in VBA)into this input box once running the macro so that the user does not have to know the password?

Here is my code for saving the file locations to something else:
Code:
Sub save_as_WB()
Application.DisplayAlerts = False
 
    ActiveWorkbook.SaveAs Filename:= _
    "[URL="file://\\Parts\CopyOfParts_Inventory.xlsm"]\\Parts\CopyOfParts_Inventory.xlsm[/URL]", _
    FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=FalseApplication.WindowState = xlNormal
    Application.DisplayAlerts = True
End Sub
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
in preventing others from saving the original file, there is an input box that comes up through vba code that asks them to enter it. when i ran the other macro that automatically saves the file, it stops as soon as it gets to the input box.

is there a way to do something similar to ActiveCell but for an input box? i'm not sure how to go about this :eeek:
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,510
Members
452,918
Latest member
Davion615

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