I'm having a problem with Vlookup locking up excel everytime it tries to call a userform. If I rem either the .show lines or the entire Vlookup loop it works. I suspected it was the exit handler but that doesn't seem to be the case. If I use vlookup code and data validation instead of vb vlookup it all works except for the problem of having the code in the cells overwritten. It's probably something really simple that I overlooked. Any suggestions would be welcome. Newvendin is a multi-input textbox and frmcalendar is a calendar....
I have the following code which filters data in a sheet, and loads the numbers into textboxes on a userform. There are two multipage controls, each with several textboxes on them. I have commented out several lines because if I leave any of them in, it crashes excel.
It will work once. But if I close the workbook, re-open it, and run the code again, it crashes.
The thing I find really interesting is that all the 'problem lines' were added in as part of a retro-fit. The person I created this workbook for needed one more column of data. I followed the same programming pattern as what I used on the other, but only these ones seem to cause problems. Any thoughts?
NOTE: The message boxes were just to help me figure out which lines of code were causing the crash. ....
I'm trying to use a listbox and wanted to have the data sit in a different sheet. When I do this, I get a message about low memory and then excel says it has an error and shuts down. When I move the data to the same sheet as the listbox, there is no problem.
I'm using excel 2000 and that's all I can get (at work). Any thoughts? Should I just put the data on the same sheet and hide it? Is there a way around this?
It is a simple form which has a Module/Macro to load the form on clicking a shape. Although the form works fine for me it occasionally crashes for other user. The Debug says that there is an error in the Module with the line "frmCallData.Show". Below is the Code for the form and also the Module: ....
On one laptop Excel crashes, without warning. It happens during copy/paste job (from one workbook to another). But not every time she copies something.
It is completly the same laptop like others in my company. My user has deadlines, and lot of copy/paste job.
I wrote some VBA code detailed here. Is there any Excel Crash log I can look at? I have tested it on three computers. It worked on my computer just fine, but when testing it on the two other users of this spreadsheet it crashes when they click the mouse on a list box after about 5 to 10 clicks.
I have the following code that (should) either save the file with a generic name if a value exists in a certain field, or else save the file as the contents of the value in the field, with a message box appearing in either case. The problem is, the message box appears twice (not once) and then Excel crashes! Can anyone tell me what's going on? The code is:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim FSR As String FSR = Range("I7").Value If FSR = "" Then MsgBox "Service Report Number not entered." ActiveWorkbook.SaveAs Filename:="Service Report Navilas.xls" End If
If FSR "" Then MsgBox "This action will save the file as the Service Report Number." ActiveWorkbook.SaveAs Filename:=FSR & ".xls" End If
As I've learned to develop Excel apps with vba over the years I've noticed that, if the Excel app starts to get too large (over 1MB) saving it will often cause the application to crash for no apparent reason - the result being that I lose all the vba code I entered before the last save - with the worst case being that, on occasion I have lost all of the vba code in an applications!!!
So, I've learned to back up often using a third-party utility that I use to save my applications, which works wonders in allowing me to save my application without it crashing. The application is called Code Cleaner 97.exe. It was designed around Excel 97 (which I still use) but if possible I'd like to get an updated version for Excel 2003 and Excel 2007, which I also use.
Does anyone know of a more recent version of this utility, or another similar utility that allows large Excel applications to be properly saved, etc?
Code Cleaner 97.exe was a freebie that was available through one of the old Compuserve Excel forums. It was a very popular utility and was suggested as a means to save one's Excel apps without the app getting trashed, etc.
I'm not expecting a freebie solution so I'll gladly pay for something that allows me to save my large Excel apps without them crashing, etc.
I have a column of data that is an 850,000+ list of phone numbers. I need to peridoically insert another 10,000+ at a time and see if there are duplicates. Using conditional formatting to highlight the duplicates with a colored cell, and then sorting those records to the top is what I want to do, but it's too much for Excel to handle, and it hangs. It looks like I need to break up the 850k records into smaller chunks. Anyone know what an average pc with Excel 07 can handle? It's a 2.8ghz w/2gb ram.
When I run a group of macros for some reason after the marcro runs and I hit F2 excel crashes.
I have figured out that it is one of the marcros that makes the excel crash. It is only when I run the solver application. The code is below. Any thoughts why hitting F2 after running this marcro would crash the machine?
I'm trying to close out excel through a user form (excel is hidden) button but excel crashes when it reaches the application.quit line of code.
I searched google and found one message that said that if you have add-ins that they can cause excel to crash when closing but there was no explanation or work around.
I have a very strange error at present. I am saving a sheet as a file using VBA from within Excel and when I run the program from the environment of my flash drive it works without a problem but when I run the same code on my main PC it causes an error :
Run time error 1004 Method SaveAs error ... and it causes Excel to crash and then recover the file.
I have created a macro in xl2000 which was working fine - although through corporate upgrades my machine has now been upgraded with xl2003 and the macro runs for a bit and then crashes on the code below, although it only highlights teh 'rnum'
rnum = ActiveCell.Row Is there a difference between xl2000 & xl2003?
I open Excel. I click Insert-> Comment. Excel crashes. I try to open an excel file with comments, Excel crashes. I have already uninstalled and reinstalled, Detected & Repaired. Nothing appears in the event viewer. I am at my wits end.
Any ideas on what this could be? My only guess is a windows issue vs. an excel issue, but I thought I'd at least ask.
I have written a fairly large spread sheet, and I have consistently had excel crashes when the first form initialises at startup. However if I resave the workbook over itself or sometimes as another name it will then work. Once it works - it will always work while I dont restart my computer. The next day the same workbook will crash on form startup. Once this happens t always crashes on startup. If it works OK first up it always works. However if I edit it the process may happen all over again. I am 100% their is no error in the code as in certain stages it has worked for months. It seams like some bug in excel? Has anyone ever had this issue?
I run a macro which runs saves the active file to a different location to ensure that I retain the original like so -
If ActiveWorkbook. Name = "KEY_DATA_CFT77" + ".xls" Then ActiveWorkbook.SaveAs Filename:= _ "H:HOME imcEXCELKEY_DATA_2006KEY_DATA_2006_01KEY_DATA_CFT77_01.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False End If .................................
I’m launching a new workbook, exporting some stuff, basically creating a report. But then I want to add a BeforePrint event to the new worksheet. Both of the macro below works great right up until I change “Sheet1” to “ThisWorkBook”…then Excel crashes.
Sub AddCode1() Dim VBCodeMod As CodeModule Dim LineNum As Long Dim Copybook As Workbook Set Copybook = Excel.Workbooks.Add Set VBCodeMod = Copybook.VBProject.VBComponents("sheet1").CodeModule LineNum = VBCodeMod.CountOfLines + 1 VBCodeMod.InsertLines LineNum, "Private Sub Workbook_BeforePrint(Cancel As Boolean)" & Chr(13) & "if ActiveSheet.CodeName <> ""Sheet1"" or ActiveSheet.CodeName <> ""Sheet2"" or ActiveSheet.CodeName <> ""Sheet3"" then" & Chr(13) & "MsgBox(""This Electronic Outcome Review Summary Report is NOT optimized for Printing......................................
I worked really hard on this userform for a work project - my first and likely last attempt at coding!
It used to work, and then I changed a bunch of listboxes to comboboxes, and now my file gives the 'Excel has encountered a problem and needs to close' error - but ONLY when I'm working directly with the excel file and NOT when I've got VBA open.
Compiling shows no problems - I have no idea what to do because this is a very important file for work and I am a very inexperienced coder! ...
Continuing with my goal to learn VBA and while playing with the following code, I encountered strange behavior of debug statements. In the code below I have put my comments to identify where the "funny behavior" is encountered.
Will appreciate if you can help me understand. I also have a simple request/question at the end of the code below: ....
Three times (by three different users) over the past two months, a workbook has gotten into what appears to be some sort of corrupted state. When you attempt to open the workbook you get the "report to Microsoft" screen which states "Microsoft Excel has encountered a problem and needs to close". Proceeding on this screen closes the entire instance of Excel, including the offending workbook and any others that are open. However, if I simply open and save the workbook in Excel safe mode, then it resolves the problem. But, again, it has happened three times so it keeps coming back.
A little more background: there is a custom add-in referenced which contains many custom functions. This add-in is also referenced by other workbooks, none of which have had this problem. The Workbook_Open event only does what I consider to be superficial processing; it hides some sheets, selects a sheet, defaults some shape colors, and defaults a checkbox to True. In other words, nothing too heavy going on at startup, in my opinion. I have tried several times to break into the code between the time the workbook begins to load and when the "report to Microsoft" screen is displayed, but this was unsuccessful.
I was hoping that the fact that simply saving it from safe mode resolves the problem might indicate the problem to someone on the forum. I have a copy of the file in its corrupted state but I have not attached it because it contains some business sensitive information.
I have a report I produce where I take an XML file, sort it and run some simple formulas then sort another way and run a few more formulas then update a pivot table. The XML files I'm using have the same headers but vary in length. When I set the macro up for a particular XML file everything works fine. When I import another one (different size) I get the error message:
Run-time error ‘1004’: Sort method of Range class failed
When I look at the code I see that the range is fixed to the XML file I used when setting the macro up. Is there a way to auto-select the table in the macro so I can run the same macro on any size XML?
My excel file triggers excel to crash after clicking the only button on my worksheet. The button displays a userform.
However; this does not always happen. It actually drives me crazy as I don't find the solution to my problem. My company were I work upgraded my Excel 2003 SP2 to Excel 2003 SP3 which seemed to help but now the same problem returned...
I found a temporarily workaround though; when saving the file first (right after I opened it) it doesn�t crash when showing the userform. Very strange (to me).
When I try to include the named range in a sumproduct statement, it crashes XL the moment I type the evaluative sign (< = >) within the 2nd bracket. Like this:
=SUMPRODUCT(--(ProjectID>2500))
(The actual formula works on several other columns of data. I'm citing a simple example, which also crashes my XL.)
Is that my installation causing the error or something wacko in XL? Please try and write back.
I seem to have a bug i can't quite figure out with my code - its causing excel to crash each time it reaches this line (when its commented out - the form runs fine - otherwise "excel has encountered an error")....
Set frameFullX = frameFull.Controls.Add("Forms.frame.1", "frameFull1") frameFullX is declared as a control and frameFull is a frame already on the userform.
Anyone know what I might be doing wrong (I'm going to try restarting and see if was just an issue with my machine or not?
I use spinbuttons to increment 3 data cells (C7:C9). These cells are used as entry data for some calculations and also trigger some macros via change event. Every time I use them the workbook crashes, this is only since I modified one of the instantiated macros that sorts a table on another sheet. See below the spinbutton code with the call of the macro and further the code of the sorting macro:
Private Sub SpinButton1_SpinDown() Range("C7").Value = Range("C7").Value - 0.05 End Sub
Private Sub SpinButton1_SpinUp() Range("C7").Value = Range("C7").Value + 0.05 End Sub
Private Sub SpinButton2_SpinDown() Range("C8").Value = Range("C8").Value - 0.05 End Sub......................................................
I'm writing an application in Excel, its a little over 5MB after I've run through UsedRegion and trimmed stuff, 94 worksheets. I'm encountering a fair number of crashes these days. My OS is fully patched as is MS Office. Running Windows server 2003 and Excel 2007.
I was wondering about the pros and cons of writing an application in one large workbook or many smaller ones. So far its been one large one but these crashes are really impeding my progress.
What's the best way to remedy these crashes or even start to diagnose?