I have an Excel macro that opens a workbook, does some operations, saves and closes it. It worked for the last 2 years.
TITUS was installed on my work machine and because of this, I have to choose a document classification manually every time code tries to save the workbook.
As a workaround, I use Application.EnableEvents = False before save and close statements. After that, the macro sometimes stops at save bar like shown in this image: Save bar
The workbook is saved but the save bar doesn't close and halts the macro from opening any other workbooks. This occurs randomly for random workbooks. For example, when workbook 3 had this issue, if I run the macro on workbook 3 again, it might or might not cause the trouble.
Related
When I close one excel workbook, any other workbook i have open skips back to the first worksheet.
I have a workbook open with multiple tabs, and for example I am working on the 20th tab, if I close any other workbook (either saving or not saving), then the open workbook will quickly flash and then I will be on the first tab. It can get frustrating to keep going back to the tab I am working on, this is happening with ym whole organisation so it could be something that happened when we upgraded to Office365. Has anyone else had this issue? Unfortunately working in one workbook at a time isn't an option in my job. Thanks in advance :)
My macro-enabled workbook has been working fine until recently. It runs fine on my local drive, but no longer saves itself when run from a remote folder. I suspect some recent updates on the server are to blame.
If I open the workbook and press the save button, a pop-up appears with a progress bar for a second or two. This has not happened before, but the pop-up does close and allow me to continue.
When I run the macro in the workbook, the last line is ThisWorkbook.Save. The same pop-up appears and hangs. If I close the pop-up and press the save button, it also hangs now. If I choose File> SaveAs, all I get is a blank page with no folders to choose from.
I have a workaround to copy the workbook to a local folder, run the macro, then copy it back to the remote drive, but this may be difficult for my users to handle.
I made a new workbook with a macro that only calls ThisWorkbook.Save from a single button, and this works fine. The problematic workbook gets data from csv files and copies it into itself. Maybe this is causing a problem? Maybe the macros are too large for the anti-malware software to handle?
Does anyone know what recent changes have been made to Server that would cause my old macro to hang on saving?
I got the macro working, but not sure why.
The problem arose with an inefficient way to merge data from two sheets together. I had been using Find, and changed it to march through the data row by row instead. The saving window still pops up, but only for a second.
I don't know exactly why the old method prevented the workbook from being saved. The main difference is that the Find method uses objects, while the method I changed it to use integers and compare cell contents with an if statement. Maybe the memory was being filled with orphaned objects? I don't see what difference that should make when saving the file. The data in the sheets being saved is the same.
If anyone knows what difference this would make in saving a workbook, please add and answer or comment for posterity. It might help someone with a similar problem.
Of the many reports I've creating in Excel VBA, I've got one report that normally launches from a scheduler with a countdown timer that will pull external data, email, then automatically close if the user doesn't press a stop button before the query process begins. I've only inserted some code that clears all cell contents and formats on the worksheet where I once had formulas and conditional formatting. After saving the report, then launching by file association as before, now only the Excel splash screen is visible while VBA runs in the background. If I insert an "Exit Sub" anywhere in any procedure that runs, from beginning to end in the code prior to the "quit" call, the application becomes visible when the code stops. It opens normally if Excel is already open. I've found that even if I manually delete the cell contents and clear formatting and save the report on a working copy of the report, it does the same thing. At no time do I hide sheets, workbook, or application. I've only found it runs normally on my own personal PC Win7-64 and Excel 2016. None of the systems report an error in the workbook.
I've tried the following without results on our business network servers and Citrix Desktops with a variety of OS's and Excel versions:
Application visible
Foreground
Windows visible
Workbook visible
Worksheet visible
Deleting the sheet and writing data to the new sheet
Manually deleting the cell contents and formats on a working version
Re-creating the report from scratch with the same code, but it still does the same thing.
Excel 2010 and 2016
32 and 64-bit versions of Excel
Operating Systems - Windows 7, 10, Server 2016
Thanks.
When a macro is long in VBA, or the task then the display starts to flicker. I think you have the same issue. So, if this is the issue then try to set the screen update off in your VBA.
To do so, go to your macro and type this code i.e.-
Application.ScreenUpdating = False
Just confirm, if its helping.
I figured out an ugly workaround. I've created a sub to call on workbook_open(). It first makes the application invisible, opens a new workbook, closes the new workbook, then makes the application visible again.
I have a process consisting of 15 macros. Each of them has to be run separately after closing and reopening Excel, otherwise excel crushes. It seems to be inefficient, so I am thinking of creating a macro in MS WORD, which could open an Excel Workbook, call a macro in it, close the WB, and do it again with the next macro.
I tried this: https://support.microsoft.com/ru-ru/help/177760/acc97-how-to-run-macros-in-other-office-programs
But it didn't help. Something is happening, but visually Excel doesn't open. If I try to open this WB - it will say it's opened, but I can't see it and it's definitely not faster.
Any ideas?
I am using Excel 2007. When I start the Macro in the workbook, I cannot do any other work in Excel. I have to wait till the Macro finishes.
Is it possible to run multiple macro in multiple workbooks at the same time?
If I understand right, you have two separate workbooks, and you'd like to be able to work on 1, while running macro on the other.
This can be achieved by running two separate instances of excel, and opening the workbook in each.
Note, if you just double click a xls, it will open in the same running instance.
So you need to actually open a new instance which will be black and go file->open and navigate to your desired workbook (I think drag and drop works too)>