activeworkbook.close

  1. H

    Need to set up a constant

    I have set up a constant as follows Const C As String = .xlsm Sub Open_Fies () Windows("M_ERT Sales(P).xls").Activate Application.Run "'M_ERT Sales (P).xls'!Data_INPUT" ActiveWorkbook.Close Windows("M_ERT Sales (P)" & "C &").Activate ActiveWorkbook.Close Windows("Open...
  2. H

    Run Macro Data Export based on name of workbook on sheet1

    I have workbook names in sheet1. I would like to run the macro "Data Export" in each of these workbooks instead of macro below. If A new file/s files are added I need to amend the macro below each time There could be between 15 -20 workbooks on which to run the macro Sub Export_TB() 's()...
  3. A

    Activeworkbook.Close Problem

    Hi everyone, im unable to open my workbook due to the code below Private Sub Workbook_Open() Dim user as string User = Inputbox ("Please type your password") If typename(user)="albert" Msgbox "thank you" Else activeworkbook.Close End sub I tried a lot typing albert in the inputbox but still...
  4. D

    ActiveWorkbook.Close SaveChanges:=True Not Working???

    Hello all I have written a macro that does various things on a workbook. The Workbook is then saved and closed using the command ActiveWorkbook.Close SaveChanges:=True this command was working fine until I made various changes but now it now longer works. The last bits of my macro is as...
  5. B

    save & Clear

    Sub SaveInvWithNewName() Dim NewFN As Variant ' Copy Invoice to a new workbook ActiveSheet.Copy NewFN = "C:\Users\Donny\Google Drive\Data\Invoice" & Range("B15").Value & “.xlsx” ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook ActiveWorkbook.Close...
  6. M

    Auto-merging several xls into one

    Hello, I need your advice, in many vba project I have to merge several xls files into one. Im using almost always following code (below). What do you think about it? Is it efficient or maybe it could be done better and easier? I would be grateful if you could provide me examples how it will be...
  7. P

    ActiveWorkbook.Close closes both target book as well as unsaved workbook

    Hi there folks, its been awhile since I posted anything so if I did anything wrong please let me know. Ok to give some background... I have a bunch of code located in an addin which opens whenever I open excel. The addin contains a custom ribbon ui with various buttons doing various things...
  8. J

    Edit Code that runs on Workbook open and closes active workbook

    Hello, I have made a code that will run when opened via task scheduler. I have trusted the workbook so it doesnt prompt me for macro. My workbook open event calls the macro. After macro is complete, it closes the workbook containing the VBA. Without blocking macro's or untrusting the folder...
  9. A

    ActiveWorkbook.Close Failure

    I have consistently used ActiveWorkbook.Close in my macros without problem to both close other workbooks and to close the workbook in which the code itself is contained. However, suddenly that function still works when it is being used to close a workbook other than the one containing the code...

Some videos you may like

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top