fname

  1. J

    Code does not create PDF

    Hi all, I have the following function code (which as it is works): Function RDB_Create_PDF(Optional Source As Object, Optional FixedFilePathName As String, _ Optional OverwriteIfFileExist As Boolean, Optional OpenPDFAfterPublish As Boolean) As StringDim FileFormatstr...
  2. J

    VBA Error code Suspected end with

    Not sure what i'm doing wrong but i am trying to save different worksheets as PDFs. When i try to run this macro it highlights End sub and says suspected end with. Sub save_Worksheets() Dim WB As Workbook Dim fName As String ' Export T-88to PDF With srcWB Dim...
  3. 6

    How do I stop formulas from referring to an old book when saved as a new one

    This codecreates a new folder with a new name and saves various sheets from the book into the folder(SEE MACRO AT THE BOTTOM). The issue is, (SECTION "3" SEE FULL MACRO)I need two sheets saved in one book. This macro works, however, once saved in the newly created folder, the formulas inside...
  4. R

    Cannot Find File error when creating multiple workbooks in a loop

    I have a macro that is looping through the creation of a new workbook, copying a sheet to it from the book running the macro, saving and closing the new workbook with a new name. I am getting inconsistent results as sometimes it works fine but usually I get a VB error "File not found...
  5. K

    Problem with Dir "Invalid call or argument" after getting new computer (moving from Windows 7 to 10)

    I wanted to separate this issue from my other post that also contained a second issue that was resolved. This code snippet worked fine in 7 but fails after upgrade to 10. I get "runtime error '5': Invalid call or argument" on fname = Dir: oldpath = "\\DSGAIN01\Commercial_Printing\Work...
  6. K

    Vba code working in windows 7 but fails after windows 10 update

    This code snippet worked fine in 7 but fails after upgrade to 10. I get "runtime error '5': Invalid call or argument" on fname = Dir: oldpath = "\\DSGAIN01\Commercial_Printing\Work Flow\WEEKLY PRESS-DIST REPORTS - COMM\02 JACKSONVILLE\" & BUNIT & "\" newpath =...
  7. M

    Emailing a form in VBA

    I figured out the code to print the form DynoFailureReport.PrintForm The problem is I also want to email the form out as well. I found this code, but it doesnt seem to view the form as something it can save to a gif to send. How do I code it so it will acknowlwedge the form is what I want...
  8. L

    VBA Run-Time Error '1004' Help!

    Good morning all, I have come across 'Run-time error '1004': - Method 'SaveAs' of object '_Workbook' failed. The code is below. Any help would be greatly appreciated. Many thanks, Sub SaveAsPDFExcel() Dim fName As String Dim sLoc As String 'location sLoc =...
  9. K

    Excel VBA how to create repetition

    Hi All, I have a short macro which opens 2 files, copies data from one to the other and saves it by a certain name (save as). So far it works,it takes the first line of my data table and updates the other document correctly. However, I need to create several new files with the data of each row...
  10. A

    Open file, if file is not there open in a different directory

    So, I am using a code to open a word file and paste there some data from excel and save it, but I have a problem. The file is in dropbox and using it from different pc it exists is a different directory: 1)C:\Users\user\Dropbox 2)C:\Users\pc\Dropbox I cannot change the folder name because it...
  11. J

    macro with If and Else to copy if Yes and leave the same if NO

    Hi guys, I have my macro here and I would like it to copy the range if the Cell W5 is Yes and if NO copy just the selected range I have the macro but the yes/no thing is quite hard. Thanks for the help. Sub OpenFile_PW() Dim Fname As String Dim Wbk As Workbook Dim Sht As...
  12. P

    Run a macro on all folders and subfolders

    I have searched here and tried about 50 different variations of "almost" what I am looking for but I cant get anything to work! I already have a macro that is adding a picture for a watermark. It opens the workbook, adds the picture, and saves the workbook. I want to run this macro on all...
  13. W

    VBA - code doesn't complete to save the workbook

    Hi All, The below code stops after it has used the group function, it doesn't change formula's back to automatic and doesn't save the sheet in a new workbook. Any ideas why? Thanks, Wes Sub Copy() Dim FName As String Dim FPath As String Dim NewBook...
  14. L

    Macro VBA Debug Error

    Hi all, I am getting a debug error with the red text below. I am unsure why there is an issue with this, any ideas? Many thanks, Sub SaveAsClosed() Dim fName As String Dim sLoc As String 'location sLoc = "I:\FST\Quality\Non-Conformance\Non-Conformance Reports\Open\Closed\" '...
  15. lrobbo314

    Change 'FROM' when sending email

    I have a couple of accounts in Outlook, and I have been trying to change which account emails are being sent from when creating the emails in Access. I found a way, but it only seems to work with the early binding method. Sub CreateEmail(rName As String, Brass As String, Agents As String)Dim...
  16. Mel Smith

    VBA to 'Save As' not working

    I am trying include code to Save As .xlsm but it doesn't save a usable file. It saves the file as intended but not as Excel.xlsm or anything else. In fact the newly saved file cannot be opened... The code I have used is: Dim Fname As String Fname = ActiveWorkbook.Name & Format(Date, "ddmmyy")...
  17. J

    Populate combobox with sheets name

    Hi, I have a Sub which selects an Excel file by dialog box. On selecting the file, a TextBox (Besides the Browse button in Userform) displays the full path of the selected file. Now There's also a Combobox below that textbox in which I want to populate all the Sheet names which are there in the...
  18. H

    Dynamic Range

    How do i make the range which is copying from the below code to dynamic. The below code is specific to one application and which is restricted to specific range "A19:v", for different applications it varies how to make it dynamic for different applications. tried different methods, subscript...
  19. Mrsbex

    VBA to save to Dropbox on any users computers

    Can any of you clever people out there help me please? I have reached the end of my tether... I have this code to try and save a workbook as an XLS file to folder in Dropbox using text from the worksheet as a filename. I had it running beautifully on Macs but we are now moving over to PCs and...
  20. S

    Create new workbook, save using input box

    I've read a lot of the different threads on this forum concerning adding a new workbook but I cannot seem to get the macro to work the way it needs to... the code below doesn't work, it's not the proper syntax but it gives you an idea of what I'm trying to do: 1. add new Workbook 2. save new...

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