close file

  1. L

    Run a macho when closing the Excel file

    Hi everyone! I have this macro and I want to run it when the user closes the file. How can I put it running automatically? Private Sub Workbook_BeforeClose(ByVal SaveAsUI As Boolean, Cancel As Boolean) last_row_ose = get_last_row("S1", "I") Worksheets("S1").Range("I12:O" &...
  2. F

    Open specified source and destination files and copy single cell value, continue until all values copied

    Hey guys, I am facing an issue where my excel knowledge comes to an end. I already have a macro to get file names from a folder and rename the files according to a New File Name. I now have one source file that contains a column with values. I need to copy each one of the values into a...
  3. L

    VBA copying range from CSV directly imto master workbook

    Hi all. Bit rusty on this VBA stuf. 1. I need to copy a range from CSV file and hoping to do that by going directly to the master workbook. 2. Close CSV workbook only. 3. Activate master workbook. the macro runs but have to (2) manually and wish to eliminate this manual task. The macro is run...
  4. F

    Open / Close Workbooks Sequentially

    I have a large number of Excel files that I need to open, wait for their opening sub to run, and then close. Then on to the next one in the list. etc. Currently, I'm doing this with a .bat file that simply lists the file names. It's pretty easy to manage. But, the disadvantage is that I have to...
  5. T

    Get filename from .txt so I can close it later?

    Hi I have code that will open a text file (don't know the name it will be but will be the only one), but I need to figure out how to get that file name so that I can use it to close the file later on. Workbooks.opentext Filename:="*.txt", Origin:= _ xlMSDOS, StartRow:=1...
  6. S

    Closing opened files (also non-xlsx) with VBA

    Hello I use the IsFileOpen function from VBA Express : Excel - Check If a File Is Already Open to detect if a certain file (pdf or xlsx) is open. How can I close a pdf or xlsx file that is currently opened? What I want to achieve: for each objFile In objFolder.Files If...
  7. T

    Close a particular Workbook.

    I have a form that the user browses to a workbook and imports all data from columns and then once the workbook that was opend is finished with it closes. however if the user closes the userform with the red X id like the workbook that was opened to close. I want to exclude the workbook that we...
  8. M

    Resolved: What if the file i want to delete has already been deleted ("kill" macro)?

    I'm using the following macro: Private Sub Workbook_BeforeClose(Cancel As Boolean) Kill "T:\usequty\Audit Reporting\T-Cross Reports\tcross.xls" End SubThe marco is working well, but it is very possible that the file has already been deleted. In such cases, I do not want the error to come up...
  9. S

    ActiveWindow.Close without popup?

    ActiveWindow.Close The above code in my macro. When I use this command, it has a popup that asks me if I want to save my changes. I want it to not give me the popup and just close the file. I do not want to save my changes. is there a command I can use that will just close the active...
  10. zakasnak

    Help! Where does this code go?

    Do I put this in the worksheet tab "View Code"? That's where it would make sense to me.... I can't tell that it's working, tho. Private Sub Workbook_Open() <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p> Dim Start, Finish, TotalTime...
  11. D

    Macro not running on other computers

    I have a macro that I created on my desktop and it works perfectly well. I sent the file to another co-worker and it fails. The macro basically opens another excel sheet, copies a few things, pastes them in the spreadsheet where the macro resides and then closes the other opened document. The...
  12. S

    How to run a macro after user has chosen save "yes"/"no" upon closing file

    Hi all, I'm making my first moves in the excel macro world, and having the following difficulty: I have an excel sheet in which I build in some checks and macros, so therefore I need to ensure that users execute macros when opening the file. I looked around on the internet and found that...
  13. E

    Close file that was inserted in excel as object as an icon

    I need some help on a VBA code. I want to insert other files in an excel file which is displayed as an icon and give the icon a specific name. I used this code: Dim fn fn = Application.GetOpenFilename If fn = False Then Exit Sub End If name = InputBox("give the file a name")...

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