saveas

  1. Ivan Howard

    Interrupt SaveAs on All new files using Personal.xlsb

    Hello all, I have had a look on a few forums and can't find the answer to my question. Please can someone give me a hand? I have Microsoft's Sensitivity Labelling software running and it requires that I select a label before I can use SaveAs for any new files. This poses as 'issue' in two...
  2. R

    SaveAs method not actually saving, wrong sheets being deleted (1004 Error)

    Option Explicit Dim wb As Workbook Dim ws As Worksheet Dim ws2 As Worksheet Dim rng As Range Dim r As Long Dim i As Long Dim er As Long Dim c As Range Dim sht As Object Dim wb2 As Workbook Dim fname As String Dim fpath As String Sub printshts() Set wb = ThisWorkbook Set ws =...
  3. M

    SaveAs CSV on Mac

    I am trying to save a new opened workbook as a csv on a Mac but keep running into error 1004: application or object defined error here is the code: Dim directory As String directory = "/Users/johnsmith/Desktop" Dim mystring, clientname mystring = Range("B2").Text clientname = Mid(mystring...
  4. B

    SaveAs file to the same folder

    Hi guys, I have a file to calculate diesel consumption per month, and I have a VBA code where I start a new month by inputing the number of the new month in an inputbox, then, it deletes values from the table, adds month name in a cell, and saves file with new month in the end of the name...
  5. D

    VBA Text Output but user can select location

    I'm using VBA to take the contents of a certain range an output it as a text file. The file is actually XML data for upload to another system, so the text file has to have a specific extension, "filename.nrc". I originally designed it to always save to the Documents folders in the users local...
  6. tzcoding

    VBA Macro to Export Data from Excel Spreadsheet to CSV

    Situation: Here is what i have working now. The VBA code will save a copy of the current sheet as an archive file in .CSV format. I'm able to assigned it to a button and it will do it on a sheet by sheet basses. This means what ever sheet the button is assigned to it will export that sheet and...
  7. J

    How stop a code if 'Cancel' is clicked in the file dialog box

    I'm using the below code to bring up the file dialog box so the user can select a file path to save a file. What I want to do is stop an error from occuring when the user clicks the 'Cancel' button in the dialog box. Currently when you click 'Cancel', it comes up with 'Run-time error '5'...
  8. R

    Copy all sheets to new workbook without formulas and macros

    Hi All, I want to copy my whole workbook (xlsm) with formulas and macros to a whole new excel file (xlsx) without any formula and macro. I've found the script below on internet and works fine but is for 1 certain sheet. How can i include multiple sheets and copy this to the new workbook? It is...
  9. R

    Saving file in current folder

    Hi, I've got a total of 3 files I'm working and I want to save one of them in the current folder. For starters, I am brand new to writing VBA so I'm sure this is all wrong. My process starts with copying a master file called "template" into a customer's folder, the customer's excel file will...
  10. T

    Forcing folder creation

    Hello everyone, I am using a script that will save a file to a specific folder based of a couple of cells. If the folder doesn't exist, the command fails. I cannot figure out how to get it to create the folder if it isn't there. Here is what I am using now: Sub File_Save() Dim Path1...
  11. T

    VBA .SaveAs to Sharepoint failing intermittently Error 1004

    Hi, Struggling with VBA .SaveAs from Desktop (365) to Sharepoint. It's failing intermittently with an "Error 1004 Document not saved." I've check the paths and they exist and receive the files when it works. I've found other documentation on this subject concerning Onedrive and Sharepoint but...
  12. D

    VBA for SaveAs, limited options for filetype, fixed destination folder

    Hi All, I've been searching around a while now and found several "almost what I need" solutions. The thing I'm working on is a VBA macro that: - triggers a save-as dialog - uses the current file name, allows a different name - limits filetypes in the list to xlsx, xlsm - allows changing...
  13. A

    VBA saveas causing corruption

    Hello all, I have a code opening a workbook then creating a copy under a new file name, but whenI go to open the new file, it says it is corrupted. No idea why. Any help would be greatly appreciated. Sub VEDC() Dim wrkMyWorkBook As Workbook If...
  14. R

    Creating multiple excel files from a template - renaming and saving them based on list

    Hello Guys! I am really new with VBA, i hope You can help me with this. My girlfriend got a task at her workplace, to create 400+ excel files. I think this could be easily done with VBA. I tried many codes, but unfortunately i don't have the knowlege to modify them at the moment, but i really...
  15. B

    Exporting tab to new book error message

    Hello, Please see code below - I currently use this to export a hidden tab from a master document. However, there are 2 main issues with it, as follows: 1) Is it possible to set a name that this exported book saves as, i.e. "Book1", and if so, can this be set so that next time it will be...
  16. F

    Workbook name and extension changes bizarrely after using worksheet.saveas()

    Hey everyone! I have written some VBA code in my workbook called "main.xlsm". In this workbook I have 2 data sheets called POS1 and POS2 that I want to export as TXT. I tried using the worksheet.SaveAs method (will paste the code below). However, a very strange problem occurs when I run the...
  17. B

    Method SaveAs of object '_Workbook' failed

    I'm trying to create a button that, when clicked, saves the whole file to a defined location under a name that is a concatenation of 3 cells. Here's my code so far but i'm clearly doing something wrong Private Sub CommandButton1_Click() Dim strPath As String Dim strFolderPath As String...
  18. J

    VBA sticking on Save As

    Hi Something strange has started happening with my code, maybe someone has seen it before? I have a spreadsheet that is used by multiple users, and one of the parts of the code is to save created sheets (using the wb.saveas ... code) This has never been a problem, and has been in use since last...
  19. M

    Save a macro file in a new file without the macros

    I am stuck. I need to save the file without macros and attach it to an email/ I cannot get any of your examples to work/ If you have another option, I will take it. Dim OlApp As Object Set OlApp = CreateObject("Outlook.Application") Dim NewMail As Object Set NewMail = OlApp.CreateItem(0) Dim...
  20. R

    Run-time error "1004" Method "SaveAs"

    Good day, I have the below REALLY simple code to save a sheet in a workbook as CSV for upload to a database, however I keep getting the Run-time error "1004" Method "SaveAs" when I try and execute it. I can't figure out what I have got wrong - any advise? Thanks Sub SaveCSV()...

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