close workbook

  1. V

    VBA Excel 2007 Security warning when closing workbook with Task Manager

    In Excel 2007 I Create file and macro (vba), I protected workbook using password and to avoid Security warning when closing file through icon red (X) and reopen file and after save my data and indeed, the problem is solved Steps 1- to avoid Security warning (code problem solved is down )2-...
  2. F

    Close a workbook, prompt to save, then save workbook and Excel

    I’ve noticed many people trying to find code that on closing a workbook will prompt to save (if changes were made) and then close the workbook and close Excel. The following code should do the trick. Place this code in a module and link to a command button or shape Sub CloseWkBk()...
  3. A

    vba code to close all workbooks except active workbook which has macro

    Hello, Trying to figure out the vba code which can help me to close all opened workbooks except the active one which has macro. Below is my code. But it does not close any workbook. Please help. Thank you in advance. Sub CloseOtherWorkbook() Dim WB As Workbook Windows("Master...
  4. 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...
  5. A

    Custom Diagloge Before Closing a Workbook *** Help Please ***

    Hi - I am trying to put in a custom dialogue & warning before an user closes the workbook. The code is working fine in all basic / primary requirements with the exception of a small glitch. When user tries to close the workbook, the code will give a warning to the user. If user hits "No" code...
  6. T

    Closing workbook variable

    I have successfully created a macro that opens the latest modified excel file in a folder. However I am unable to close the workbook after I open it. This is what the successful macro looks like: So when workbook opens this is the code that I have used in an attempt to close it This doesn't...
  7. T

    Quit application only if this is the only work book

    I have a workbook called orders.xlsm. it operates entirely from userform so therfore i have the workbook hidden and the user can only see the userform. on the close of the userform the code is as bleow. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode =...
  8. H

    VBA close without saving on read only file

    hello people. I am confused. I have written a macro which asks various questions of users in message boxes, then copies the results sheet to a new workbook, which is saved with a new name. So far so good. However, having saved the results, I wish to close the original questionnaire file...
  9. already

    excel crash when using macro to close workbook

    Hi In my last thread I thought that a conflict between macros causes to crash excel (2007) . But this is not true. I have the following strange problem. A simple macro 'ActiveWorkbook.Close' causes excel to crash if I use it with a button on my sheet (a form). When I run the macro via...
  10. B

    VBA Command to close specific workbook?

    Hi all, I've got an excel file which end users open as a template, then once they've put header information in, gets saved as an individual file. After this has occurred, I've got a userform which is called from another workbook (the reason for this being that the form has bitmaps in it, and...
  11. D

    Opening and closing Files within a Macro

    I have a long macro that adds data to four workbooks and saves the data. It then copies and pastes info within the workbook running the macro, prints two forms, gives the workbook a new file name (save as) and closes the workbook. I currently have all the workbooks open on my display. Is...
  12. A

    reference id

    I have a workbook that can be opened by different users at the same time. My goal is to ID each time it is being opened so it can be saved by that ID. What I am thinking is to date, time and user stamp the workbook everytime it is being opened. And because it needs to be unique, a database...

Some videos you may like

This Week's Hot Topics

Top