fpath

  1. kelly mort

    Need help to fix Dir error (Run-Time error 5) - Invalid Procedure or argument call

    I have tried to add some pieces of codes together to produce this piece of algorithm for myself. When I run it and it does not kill nor move any file, then it reports the error message, Run-Time error 5 invalid procedure or argument call then it highlights the line: OriginalFile = Dir The...
  2. A

    Creating Folders with VBA

    Hi all, I have been reading all posts but cant come across the answer. I am using this code: Sub createFolders() Dim fpath As String Dim i, xc As Integer For i = 1 To ActiveSheet.UsedRange.Rows.Count xc = Range("XFD" & i).End(x1ToLeft).Column If xc = 1 Then fpath =...
  3. N

    Moving files Macro

    Hi, I am still fairly new at coding. I have this macro (not mine, I didn't write it) that works perfectly but I don't want it to copy. I want it to cut and paste the files instead of copying. That way, they no longer exist in the folder from where I moved them from. I have tried to figure it...
  4. G

    VBA to create new worksheet and using values from original workbook for SaveCopyAs name and path

    I have the following VBA which works to take data from the Workbook, create a new workbook and paste that data. Now I want code to utilize the SaveCopyAs to automatically save the file with name (fname) and path (fpath) taken from the original Workbook. I just don't know how to do this. The...
  5. H

    Open/Import/Close using a Server Address

    Hi - I have this code for opening a closed workbook, copying data, then closing the workbook. How do i change the fPath to use "\\Server\Folder\SubFolder\SubSubFolder" instead of using a drive letter? thanks! Sub Test_GetValues() Dim fPath As String, fOpen As Variant, wb As Workbook...
  6. N

    When Closing the Workbook which is Opened : Subscript out of range Error ALso to clear contents and format of range

    Hi I have Project.xlsm file when userform of "Project.xlsm" initialised it opens one xlsx file. "StarServices.xlsx" there is also worksheet name "Dir-File-Names" form where the "StarServices.Xlsx" is opened Having coded in UF "Project.xlsm" Queryclose to close the xlsx Subscript out of Range...
  7. O

    Automatic saving to multiple destination.

    Is it possible to save your workbook to 2 destinations? When I try to put 2 destination on VB it doesn't work. Sub SaveAs() Dim FName As String Dim FPath As String Dim NewBook As Workbook Application.ScreenUpdating = False FPath =...
  8. A

    VBA, open concern folder directly and message display off

    I am using following code; Sub t() Dim sh As Worksheet, fPath As String, fName As String Set sh = ActiveSheet fPath = "ThisWorkbook.Path\Backup\" fName = Application.GetOpenFilename("Excel Files (" & fPath & "*.xlsb)," & fPath & "*.xlsb") Set wb = Workbooks.Open(fName)...
  9. V

    Loop through slicer and save to PDF

    This has been asked here and other sites, but for the life of me I can't figure out how to get it to work. I have a workbook built in Powerpivot. First sheet is a bunch of slicers for province, city, area, region, division. I want to loop through the divisions and save the second and third...
  10. S

    Deleting Source .CSV file after embedding it to worksheet via VBA

    Hi…I’m trying to embed a .csv file to an excel sheet and then delete the source file using Windows 10 and Excel 2016. My code embeds the sourcefile to the worksheet ok but when it tries to delete the original .csv file I get a “Run-time error ’70’: Permission denied message. I’ve tried the same...
  11. P

    How to handle .VIS file name in VBA using wild cards

    Guys - I am trying to open .vis file using wild cards. The wild card is not working for one particular scenario. The below code is working fine if the File Name is Trial.vis. But, it will not work if the file name is Trial_RE.vis. (However, for .xlsx, it works fine for both the scenarios)...
  12. Z

    VBA to export dat files from each row of a workbook

    Hi all, i need help writing a macro that copies specific data from each row of a workbook and puts it into a separate dat file for each row. So far i was able to write something up that only works for the first row(seconf beneath header). How can i modify this to export each row on a separate...
  13. P

    Infinite Loop Help

    As the title states my msgbox within my userform is stuck in an infinite loop. I decided to include every command button code there is on this form in case it will help to solve this problem. Also there is also one textbox as well. I've tried various types of loops except the For Loop because...
  14. L

    file save as dialogbox date - error

    Hello VBA beginner here. I am trying to make a Macro command, that will open an old file, then use a dialog box to ask user to enter a date and use this date to partially re-name the file and save into a new file. (Then I move some data from another file into this renamed file). But excel...
  15. P

    Compile error help and centering Title on userform

    The below code gives me a compiling error. "Compile error: Wrong number of arguments or invalid property assignment" The error seems to occur on the .Filters.Add The .Add is highlighted in blue if that helps. How can I center the title text on a userform. Private Sub cmdBrowse_Click()...
  16. B

    Email clickable link from Excel VBA to Outlook

    Hello, Thanks for reading this. I'm trying to email a clickable link with VBA to outlook. I have the below code which does everything I need but the link that is emailed is not clickable. I is emailed as a hyperlink and the path is correct (if I past the path into the address bar the file...
  17. L

    VB Code Working in 2013 not working in 365

    I've been using this code for over 5 years (since Excel 2007), and it's worked fine until I begain using office 365. I have the 32-bit version installed but I am unable to us VB to create PDF's not only with this code, in this workbook, but in various workbooks where I used to be able to. Any...
  18. H

    Save .pdf in specific location

    I have this which works great...except for the file location. For some reason it's forcing the file save to c:\users\username\documents I ultimately don't want it in Downloads at all but I'm using this path for testing. I'm sure it's obvious but I'm clearly missing something. Anyone help...
  19. S

    VBA: Capture Computer Name and Insert it into String.

    Hello, I'd like to be able to send this file to other people and have it work for them, without having to go through some of the VBA editing that I must go through presently. The macro works fine, but when it goes all the way to the file destination, it says that nothing is present. What this...
  20. K

    VBA error 'Object required'

    The code below is returning error: Run-time error '424' Object required, marking line lr = wb_ReportFra.Sheets("g1").Range("A" & Rows.Count).End(xlUp).Row As far as I can understand I'm pointing out both wb and sh in this line, so what's the problem... :) Anyone that can spot what's wrong - and...

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