close a workbook

  1. C

    Excel workbook cannot close

    I have written a code to save changes to m excel workbook and close it. The code works fine except for the close part The workbook is close but the excel window still there and I still need to close it manually. Please advice. this is my code: Sub done() ThisWorkbook.Close savechanges:=True...
  2. dss28

    Excel crashing after running workbook save, close vba code

    While executing the following code I always get a message that "MS OFFICE EXCEL HAS STOPPED WORKING... ...... CHECK ONLINE FOR A SOLUTION...... CLOSE THE PROGRAM TO RESTART ......." Request to guide Private Sub cmdLogout_Click() ActiveWorkbook.Save ActiveWorkbook.Close...
  3. K

    Function .Activate and .Close not working on Mac/Excel 2016 - workaround?

    Hi team, I have a Macro that runs like a dream on a PC, but on the Mac (which is the computer I use) it does not. I've traced it to the two lines highlighted in red. The macro runs when I remove them, but that means I have to manually close hundreds of files. Is there a workaround or fix for...
  4. B

    Countdown start upon opening of Workbook - close after 20 min.

    Hi, I presently have a workbook that numerous individuals can access but I need it the Workbook to automatically close after 20 minutes. I have entered coding and the workbook does close but regardless of the time I insert, it closes after 2 minutes Private Sub Workbook_Open()...
  5. D

    My sequence of Macros stops running after one of the macros closes another workbook

    Hi everyone, Hope you're having a great Friday! I am running a sequence of macros as follows: Sub RunMacroSequence_Click() Call ClearContentsBelowRowTwo 'Macro1 Call copyDataFromMultipleWorkbooksIntoMaster 'Macro2 Call ExportOpsManPOReconExport 'Macro3 Call...
  6. T

    Save and Close Button

    Hi, I have a workbook which a lot of people will be logging on to just put their name next to an activity. As I don't trust their housekeeping skills and the sheet works best to a newcomer in a certain format I want a button that say 'Save and Close' that will do the following: collapse all...
  7. K

    Closing random opened workbook.

    Hello All, I have some workbooks open (manually), now I am trying to close 1 of them using VBA function Workbooks.Close(). Somewhere I found a way of doing it Workbooks("FileName").Close but somehow for me its not working and throwing error which says "Subscript out of Range". The code that I...
  8. FalconBLUE

    Find A Value in Closed Workbook

    Hi everybody, I'm working on a project and came across a problem. I hope you have the solution. I want to find a selected person name and surname by textbox on a userform in closed workbook sheets. This workbook has 21 sub sheets. Actually, I wrote a code as below but didn't work. I think it...
  9. P

    Close workbook when UserForm is closed, or close excel when no other workbooks are active

    I have a workbook that, upon opening makes the application invisible and opens it's userform: Private Sub Workbook_Open() Parent.Application.Visible = False UserForm1.Show End Sub There is a button on the form to unhide the parent application again, in order for users to modify the sheets...
  10. N

    VBA - Unable to close open workbook

    Hello all, My VBA Code allows the user to choose a workbook to open. First they select the wb from the directory and then that wb is opened. the issue comes when the code tries to close the wb that was just opened. There becomes an error on the red text line. Any idea why this may be? The code...
  11. B

    Application.DisplayAlerts=False & ActiveWorkbook.Saved=True Not Disabling Save Prompt at Close

    I am using TaskScheduler to open a spreadsheet to run an Auto_Open subroutine. The Auto_Open subroutine calls various subroutines to pull data from a server, perform calculations, update charts, export pdfs, and send emails. At the end of Auto_Open, a timed popup allows user intervention to stop...
  12. C

    VBA to close workbooks

    Hi there, I have a macro which opens files based on the contents of a cell range. This cell range has the file names and the macro specifies the folder directory. The macro opens whatever cells are selected and then it closes all files. I want it to run as is but with one minor tweak - only to...
  13. T

    Close Workbook Based on Cell Value

    Hi! I am able to open the file I want using this: Workbooks Range("bd1").Value & ".csv" But how do I then close it later on? If I understand how this works correctly, I need the full filepath to open a file (i.e. the value of cell BD1), but only the book name to close it, right? In this...
  14. F

    Saving and closing workbook in userform when BeforeSave macro is enabled

    Hello, this is my first post to this forum, when I might do something wrong, please tell me so I can learn! I have a quite complicated excel-vba file written in Excel 2010, running on Windows 7. In this file, I have following code (copied from a forum somewhere and changed a bit) to force...
  15. S

    Two Problems 1. keep getting a clear clipboard message 2. wont close workbook completely

    Hi, I have to code below which works but there are two things that I need it to do. 1. at the point of paste don't ask if I was to clear the clipboard 2. completely close the Email_Report after its finished Sub copy() Sheets("DATA").Select Dim wb1 As Workbook Dim wb2 As Workbook Set...
  16. K

    Save Changes:= False property not working

    Hi All, I have written a code which uses the Save Changes: = False property of the Activeworkbook.close method. However, on running the code the user is being prompted to save the file. The code snippet looks like this: Dim w as workbook Set w = workbooks.add w.Close SaveChanges:=False I...
  17. D

    VBA Close workbook without saving message box

    Hi all, I am trying to close a workbook that I have just copied data from and I don’t want to receive the “do I want to close without saving” message. The section of code in question currently looks like this: ' Close customer workbook customerWorkbook.Activate...
  18. R

    Avoiding #RIF while connecting to other closed sheet

    Hi everybody, I have been facing an annoying problem for a while and I want to finally fix it! :mad: I got a master spreadsheet from which many other sheets take several values. Of course if the master sheet is close, every other document reports #RIF errors. :crash: I was wondering: there...
  19. P

    copy user selected workbook into current workbook then CLOSE the selected workbook

    The following code works fine but it leaves the the selected workbook open......... what code do I need to add to close it Sub Get_Data()FileToOpen = Application.GetOpenFilename _ (Title:="Please choose a file to import", _ FileFilter:="Excel Files *.xlsx (*.xlsx),") '' If FileToOpen = False...
  20. S

    Closing time

    I have an 80 MB excel file that only takes about 15 seconds to save, but takes almost 10 minutes to close. It takes bout 3-4 minutes to open. Any idea why it closes so slowly? What can I do to speed it up?

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