strfilename

  1. Y

    Save Copy File as Read Only (VBA)

    Hi dear, I am still learning about vba. I have a code to create copy/duplicate file to other directory, like this: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim wb As Workbook: Set wb = ThisWorkbook Dim FSO As Object Dim strTargetPath As String...
  2. V

    Attachment Download

    I have the below code and have it is on Outlook VBA on ThisOutlookSession But I am still not able to download the attachments in the folder, I am trying this for quite a while now but no luck, did google as well. It is not showing any error, but still not downloading the attachment in the...
  3. I

    VBA to open a PDF in another location.

    Hi All I have the following code that searches a network folder for a PDF doc based on the number in a cell and opens it if one exists: Sub OpenPDF_3() Dim strPath As String Dim strFileName As String strPath = "\\172.27.154.13\D$\Excel Dashboard\Inventory" If Right(strPath...
  4. Y

    Outlook VBA: Save attachment, open excel, run a macro and resend out as an attachment

    Hi, I am still relatively new to VBA coding though have been running files with inbuilt macros. As my knowledge is limited to using existing codes and modifying from there, I hope fellow members in this forum can guide me through my issue below. I am trying to complete a VBA code in Outook -->...
  5. K

    Closing & Opening Files

    I am using the following code to create a duplicate of an active file and then close the active file. But I am struggling to open the file I just created. Will appreciate some hand holding. Sub Copy() Dim strFilename As String strFilename = ActiveWorkbook.Path & "" & "GJCT Roster Week " &...
  6. B

    VBA: COmparing two word documents if similar

    Hi All, I'm trying to create a code to compare two word documents if identical. However, I always get the error, "User-defined type not defined" Sub CompareAllFiles() Dim strFolderA As String Dim strFolderB As String Dim strFolderC As String Dim strFileSpec As String Dim...
  7. A

    convert Chart to picture

    I need to generate a report by pressing a button. I use VBA to extract worksheets to a new workbook using a button a lot, but this one I can't figure out. What I would like is for the 2 charts on the active sheet to not be charts with links on the new sheet (so the report that can be provided to...
  8. M

    Copying File Names from folder to Workbook

    So I have this code, and I would like to adjust it so that instead of running the script until there are no files left to be copied, I would like for the code to continue its loop (purposefully) for at least 500 or more times WHILE inserting/clearing cells in the column it was formerly copying...
  9. B

    Keeping default signature when sending emails from Gmail using vba macro

    Hello, is there a way to keep the default signature associated with my gmail account when sending an email from Gmail through VBA (I am using CDO if that can be helpful). Below is the bit of code relevant to the email configuration: everything works fine except for the missing signature. Any...
  10. S

    Use this UDF created in Excel in Access

    Hi guys, I was hoping for some help. Sub Importieren() Dim appExcel As Excel.Application Dim objFiledialog As FileDialog Dim FileWasChosen As Boolean Dim wbkQuelle As Workbook Dim wksQuelle As Worksheet Dim varPfadDatei As Variant Dim wksZiel As Worksheet Dim...
  11. R

    Import files into the excel with same prefix

    Hi Everyone, I am struggling to create a macro which will import all files from predefined folder having same prefilx. Kindly refer below for more details: C2 = ShareDrive link in which i have files Files Name = Sample 1.pdf, Sample 2.pdf, Sample 3.pdf I have below code by which i can upload...
  12. R

    Upload multiple Object into Excel - Code amendment

    Hi Everyone, I have a code to upload an object into excel. However below code i am able to upload only one document by clicking on button. Please help me in amend the code by which i can upload multiple file. note - other file path would remain same. However name could be sample2.pdf or...
  13. D

    Macro to copy certain sheets to a new workbook, then save the workbook, naming it the worksheet name

    Hi guys I am trying to write a macro that will copy a worksheet, then save it using the worksheet name as the filename. I then want it to go to other worksheets, in the same workbook, and do the same. I was trying to use a list of names typed on a worksheet (List of Names) to tell the macro...
  14. E

    Macro for Autosaving excel file once a day to a different directory with name + date

    Hi, I'm looking for a macro code which autosaves excel file once a day while it's open. I have found a code which would suit me but doesn't always work, maybe somebody could help me ? Code: Option Explicit Private Sub Workbook_Open() AutoSave 'Start Autosaving End Sub Private Sub...
  15. S

    Avoiding Error if User clicks the Cancel Button in BrowseFolder

    Hi I am using BrowseForFolder to Select Folders. The code works fine but everytime I click the "Cancel" Button an Error occurs. Here is the code: Dim objShell Dim strFileName Dim strFilePath Dim objFile Set objShell = CreateObject("Shell.Application") Set objFile = objShell.BrowseForFolder(0...
  16. I

    Can you check my code please

    Hi, I have an excel sheet of which i would like to copy a specific range, then save that range as a pdf file on the desktop. When the file is saved it just needs to be called LR CODES The range to copy is A1:K16 I have the code below but not entirely sure its correct,because i copied it from...
  17. E

    Open the Current Directory (on SharePoint)

    Good Day! I have a workbook that I have put in the below VBA. In theory, it is a simple and straight forward module..open workbook, copy from it, paste into another workbook, close workbook... I am trying to make this as end-user friendly as possible, as not all of my users are not...
  18. U

    Code works fine copying to word until I repeat on the 4th time

    Here's my code to copy a table into Word Sub CopyTable() Dim wdappWord As Word.Application Dim docWord As Word.Document Dim strFilename As String Set wdappWord = GetObject(, "Word.Application") 'Set docWord = wdappWord.Documents.Add strFilename = "C:\Excel\Excel Test.docx" wdappWord.Visible...
  19. P

    Establish Connection to Network Drive (not mapped)

    Good evening, Please can someone help with this. I have a macro workbook that accesses a SharePoint folder to import some modules. This works perfectly well if the user has mapped the SharePoint drive to their computer (I guess because Windows establishes a connection to this drive when...
  20. T

    VBA Code that pulls a file that has a dynamic ending

    My file path (\\cat04\PAT\PROD\CAT\STUCT\In\CEE\) does not change, but the file name will change daily. The tab labeled Main (a8 in this case has 11-17-2017) will have the date that I would like to pull. The current code written below will try to find...

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