Hello everyone,
This thread is related and inspired on an old one: Force users to save as .xlsm or xltm only.
In any case, I tried to replicate the code for XLSM and PDF format only. No luck. Although the two options are available, the PDF one didn't produce any good file. I would like to...
Hello,
I have the following code:
Sub VisibleSheets(Optional ByVal Control As IRibbonControl)
On Error Resume Next
Dim ws As Worksheet
Dim wbNew As Workbook
Dim WSHShell As Object
Dim DesktopPath As String
Dim VendorName As String
Dim StoreName As String
VendorName = Range("I2")
StoreName...
Hello,
A project I'm working on has a button that is supposed to create a static, macro free copy of the workbook and save it to the folder which is located on OneDrive. This button will be used by multiple users, not just me. I have this coded and it works perfectly whenever I test it, but...
Hi all,
I am working on a macro that makes users click "Enable Content" mandatorily to access the workbook, works like a charm, except I have a macro which does a .SaveAs under a different name, and it automatically closes my original file, but doesn't initiate the "Workbook_BeforeClose" code I...
I want to disable both Save and Save As - I have VBA that saves the document specifically for the user and I don't want them to try and save it as their own file.
I have this:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI = True Then...
Hi All,
I'm currently trying to copy certain worksheet in my workbook and then save it as new excel file in download folder.
Sub RectangleRoundedCorners1_Click()
Dim FName As String
Dim FPath As String
FPath = "C:"
FName = "ResultsLessThan" & Format(Date...
So currently my code has vbQuestion & vbYesNoCancel. I am trying to figure out if I can replace Yes No Cancel with my own options. Preferably (not necessarily) without editing code too much.
If Dir(FPath & "\" & FName & FExt) <> "" Then
wAns = MsgBox("The file already exists. Do You...
My file is saving the entire name when it converts to a PDF. I am simply trying to get the .xlsb part to drop off. Can anyone help me understand how to code the removal of the .xlsb from the Filename or Populate the save as name as one I choose?
I want to use this base code.
Sub...
I have the Following button code that saves my workbook at a desired location (Save As) with a desired name without including the pages "Main" and template".
Right after I save the copy, I have another button that when clicked, it closes my "Master" workbook without any changes but keeps excel...
I am looking to create a loop to execute on a specific set of files inside a folder that contains 30+ files.
Dim wb As Workbook
strFileName = ThisWorkbook.FullName
Workbooks.Open Filename:= Folder & "File Name 1.xlsm"
Set wb = Application.ActiveWorkbook
If Not...
So my code works differently in a the same file, but in a different file path
Sub SaveAsExample()
Dim FName As String
Dim FPath As String
On Error GoTo Handler:
FPath = Sheets("Setup").Range("A1").Text
FName = Sheets("Setup").Range("G1").Text...
So surprisingly I didn't find such a simple addition to the save as macro that already exists. So I created it myself.
There is already a macro that does saving as based on value in cell, but when this file already exists it pops up an error if you don't replace the file
My objective was to...
Hello all,
I am looking to make 1000+ reports based on a template. I have other sheets referencing the target city to update the data they report on.
I have a macro that saves the current workbook following the naming convention "Target #". In this case "Austin 1". I will then change the...
I am trying to write some VBA so create a save as button that saves the document into the correct location and creates the correct file name... I am a bit of a VBA noob, I can do basics but this has me stumped!:confused::confused: Please see the code below that I have tried to butcher from...
Hi All,
I have the following macro which works fine, however I would like to expand on it if possible.
I would like the macro to create a file with the date if possible, where the file is then saved.
Potential issue is that I may be running the macro multiple times in a day so I imagine it...
Hello,
I have the following code which names a sheet after a specified cell and then copies into a new workbook.
The next stage attempts to save the workbook after another cell value however this is where I became stuck.
Cell D2 can contain special characters so the save as isn't working...
I am running Windows 10 with Excel and I have a macro which manipuates an excel file, then ask the user to save as a different workbook name. The macro takes a copy of the ActiveWorkbook.Name of the main workbook and opens a reference excel file. When trying to switch windows back to the main...
Hello,
I'm trying to copy every sheet in workbook as separate file (on X drive) with the name of the sheet with below standing code. It now creates a single file with the name %20&%20ws.name%20&%20 including all sheets. What goes wrong here?
Thank you, Hans Grandia (Netherlands)
Sub...
I have a file that saves everyday at 1am. It is locates on a network drive in a specific folder. I cant figure out why it saves to the drive and saves to the local PCs documents.
Sub sveWrkBk()
Application.DisplayAlerts = False
ActiveWorkbook.Save
Application.OnTime...
Hello all, I am looking to prevent my users from utilizing "Save As" for a word2010 document. In other words I want them to be able to save changes onthe master file that is accessible to the multiple people that need it but not be able to create an editable copy as inevitably they edit that...
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.