Changes don't get saved in Crystal Reports report - visual-studio-2012

I've started using Crystal Reports recently. Have been able to create a report and mostly done with it. But suddenly I started to lose any change made inside a textbox object. I edit a textbox, save the report and close it. And then I reopen it to see that the change hasn't remained. I restart the Visual Studio and even the machine but nothing helps. I use VS 2012. Has anyone experienced anything like this?

In the report preview see if the checkbox "Save data in the report" is checked. If so, try unckecking this checkbox. It is causing me some trouble to save the report crashing Visual Studio interface.

In fact I found the reason for the problem. This happens when I try to save the changes while the focus is on the edited object, in this case textbox. But if I click somewhere else (in order to lose focus on the edited textbox) before saving, then the problem gets solved. Happy to have found it.

Welcome to the club :)
Crystal Reports can behave very strangely in some cases. For instance, some times when i edit a report file in Windows XP, it crashes the interface and corrupts the file when i save it. The same problem doesn't appear in Windows 7. However other strange things happen in Windows 7 also.
I would recommend you to
Always apply the latest Service Pack available for the Crystal Reports Engine.
Always check if the asterisk sign disappears from the opened report file when you save it (some times it doesn't when you hit save and it does when you hit save all and vice versa).
Always backup your report files once in a while because to recover a corrupted file is a very hard task.
You can try the following to find out what causes the problem
Create a new blank Windows Forms project, add the same report file there and check if it behaves the same.
Create a new blank report file and check if a change in a field behaves the same way after saving it.
Try it on another OS.

Go to Database | Verify Database and make sure the database is up to date.
Also Go to Database | Show SQL Query and reset the query. Now enter in the Selection Formula again and save.
Updating the SQL will replace the Selection Formula.
Good luck,

Related

"Loading .NET Framework" message when loading an empty workbook in Excel

When opening a particular Excel file, it takes 4 minutes for the message Loading .NET Framework... to clear up. Once it opens, it works fast, as expected. The only suggestion I found was to launch Excel in safe mode. It has the same behavior. I deleted all worksheets, connections to exterior databases, Power Query, VBA, names, and I saved it as XLSX. Still the same behavior.
If I close the spreadsheet (but not Excel) and open it again, it opens fast.
What's even more puzzling is that on some colleagues' machines, it has the same behavior as on mine, and on others, the message Loading .NET Framework... doesn't appear at all (or it is too fast to notice).
Do you have any idea how to get rid of that message short of reinstalling Excel?
Thank you.
I got the answer to my question from here:
https://techcommunity.microsoft.com/t5/excel/loading-net-framework-soooooo/m-p/2264145/highlight/true#M95862
You can get rid of loading .net framework in Excel 2019 by doing File, Info, Check for Issues/Inspect Document and ticking Custom XML Data (you can tick everything else as well, but it will take a long time). It will tell you that Custom XML Data was found, so press Remove. Then close and save.
Next time you open up, no .net framework, and it's much faster.

VBA editor in any Office 365 app not opening anymore

I am using VBA in most of my office 365 applications for many years now. Last week an error appeared that I can't fix anymore, without having to create a new profile in windows (according to Microsoft helpdesk). Besides that this is quiet a lot of work that I would like to avoid, if this is the only solution, I like to know what happened and why, to prevent future errors.
Problem: in any office 365 application, when opening the vba editor, in the taskbar, a window appears that I cannot open and that looks like a corrupted editor window. Hence I cannot edit my code anymore. The code is runnable though from the developers-macros-run-menu.
Cause: I ran a code from ms-word, that saves the pages from a merged document into separte files, .docx and .pdf. The code was running fine, but after a little editing started to quit before the last page was reached and after some time trying over, I couldn't open the editor anymore. I am not sure if this error is caused by the code, or something else.
Unfortunately I cannot display the code here, because I can't open it anymore.
I updated Office 365 to the last version, without any result.
Creating a new Windows-account solves the problem, but implies that I have to reinstall many apps and services.
Does anyone have had the same experience, what is the problem and/ or what can I do to restore this error other than the new-account solution?
The VBA Editor window moved off screen. This might have been caused by accidentally pressing WINDOWS KEY + SHIFT + ARROW (not likely), or by a problem in windows 10.
For a solution see https://superuser.com/q/53585
I'd the same problem.
That´s just a question of hidden windows. Just press shift and left click on top of the code window in the task bar. Then select maximze and your window will appear.
Hope it helps.
Joao

Excel crashes when loading file that contains userform

Excel crashes when opening files that contain a userform
This is a known problem with a known solution workaround which is to delete a file called Excel.box from here:
C:\Users\SlowLearner\Application Data\Microsoft\Forms\Excel.box
According to this forum post the purpose of the Excel.box (& Word.box) file is:
Files such as Winword.box and Excel.box are associated with the
Control Toolbox you see when you are designing a UserForm in the
Visual Basic editor. The files contain information about the layout of
the Control Toolbox (additional tab pages, controls that have been
added or removed, custom icons, ...) If a user has never modified the
Control Toolbox in any way, there will probably be no .box file. By
deleting a .box file, you will restore the Control Toolbox to its
default (factory preset) configuration - this is the only way to do
that. Sometimes, the .box file becomes corrupted and must be deleted.
There are no negative side effects to deleting it.
Unfortunately Excel.box returns :(
It would seem that for most users the problem is fixed by deleting the file, sadly not for me.
I'd like to understand what is causing this problem to recur. A few points to note:
this (touch wood) is not impacting MS Word on my PC
I am using Office 2010, 64 bit version on Win10
I have not made any conscious change to form settings
if I delete the file > start Excel > UN-DELETE the file: everything works :-/
some other experiences with this issue here
For the time being I'll just check for and delete the file before launching Excel, but this is hardly an acceptable solution for the long term. Appreciate thoughts for a proper fix... TIA
Additional Information:
I have not fully explored the crash but so far it happens when:
starting the application by opening an xl?.m file with a userform
application does not get past the splash screen
crashes with the application's CRASH screen (... encounted an error...)
starting the application with a blank worksheet then adding a userform
crashes immediately with the applications CRASH screen displayed (see below)
The above crash happened after rebooting my PC, had a chance to explore it some more.
First I opened the file I had been working on (contains userforms):
annoyingly it opened without crashing
I did NOT enter the IDE
I closed the file (Excel closed normally)
Then I created a new worksheet
I opened the VBA IDE
right-click 'add UserForm' - Excel crashed immediately
(I aborted the recovery / search for a solution attempt)
Then I re-opened the file I had been working on
opened the VBA IDE (the project is PW protected)
the very instant that I entered the PW and hit enter Excel crashed
crash was same both times...
Safe Mode:
Crash still happens in safe mode - steps to reproduce:
Run: Excel /safe
Open VBA IDE
r-click add userform
crashes immediately
Creation of the EXCEL.box file
Based on visually observing the folder which had the Excel.box file I did some tests to try and see when it was created. Basically it seems to appear when one of the following happens:
- the UserForm tools box is closed
- the IDE is closed (after showing the userform)
I've also now tried to modify the userform toolbox by removing everything from it. Excel is still crashing after every restart of the application (which is odd as I was not able to crash it like that earlier).
Office Repair - not tested (yet)
Reluctant to try Office Repair as based on the following quote from here (scroll down: pg 1 reply 8 by Steve IT) I'm not expecting it to work :-/ (but will try if no other suggestions surface).
Thanks for the continued suggestions, however I have tried a repair and also removed Visual Studio 2013 and Office altogether (just in case VS was interfering) and reinstalled both, but it still throws the errors reported previously.
Other user profiles
Created a brand new user called 'test'. Test has the exact same problem.
This problem eventually resolved itself, not sure why. I continued to use Excel normally and it continued to crash so I would delete the offending .box file and start over...
As of Nov 2017 Excel no longer crashes with respect to this issue; my best guess is there was an automatic update that resolved the issue.
Looks like this issue still occurs and it is not just limited to Excel but also Powerpoint.
The fix as mentioned above works where you move / delete any files in the below folder location resolves the issue.
C:\Users\%username%\Application Data\Microsoft\Forms
It is highly likely that this error is caused by bad code in a macro or an Add-In that uses forms. The problem is replicating this can be difficult so you have to debug this in some way when it does crash out.
POWERPNT.box
EXCEL.box
are some of the files that get generated, where Excel or Powerpoint crash on the splash screen.
Try adding the command
ThisWorkbook.VBProject.VBComponents("UserForm").Activate
just before your
"UserForm".Show line.

Excel crashes when pressing "developer tools" button

I have the following problem in Excel:
I wasdevelopping a template in Excel VBA. I was tearing a sub routine in break mode and tried to stop it to change the code. When I pressed the stop button, however, Excel froze so I had to kill the process. Although before the crash everything was ok, opening the file would cause excel to freeze and crash again. Obviously the file got corrupt. I used a previous version of the file and decided to redo the changes. At some point the problem happened again. When I finally managed to open the file, everything seemed ok, but pressing the "developer tools" button on the ribbon crashes excel. I desperate. The Template is 90% but making even the slightest change feels like disarming a mine bomb that can blow the template up.
Does anyone know how to bypass the problem?
Here is what I would suggest:
get another PC with the same version of Excel installed,
Install the VBA CodeClener Add-in (http://www.appspro.com/Utilities/CodeCleaner.htm),
Copy your (prior) spreadsheet over to that PC, open it, open developer tools and run CodeCleaner.
Add your changes.
If that works, then reinstall Excel on your first PC. If not then you will have to take drastic measures:
Open the prior version,
Make one (or a few) change at a time,
After each small set of changes, save a new version of your Excel file, adding a version number to the file name (update the version/file name each time)
If it fails again, go back to the previous version, and the try to figure out which of the small set of changes may have corrupted the file.

VBA editor auto-deletes spaces at the ends of lines

Is there a way to convince the VBA editor in Excel to stop auto-formatting lines to remove the space at the end when I pause in my typing for a quarter second?
I had this exact problem and the following worked for me.
Click the Microsoft Office Button, and then click Excel Options
Click the Add-Ins category
In the Manage box, click COM Add-ins, and then click Go.
Look for an add in called 'Load Test Report AddIn' then uncheck it
restart excel
This addin is installed with VS2010 Beta2
In Excel 2010, toggling Design Mode button on the Developer Ribbon Tab solves the problem for me.
I've definitely had that issue before, where the vba editor would format as I was typing (not just when I went to another line). For me, it seemed to be related to a Microsoft Web Browser control that I had in an open workbook. When I took out the web browser, the VBA editor started acting normally again. I have no idea why that worked, but it did. Now I avoid using that control in my workbooks.
Something is causing your spreadsheet to recalculate while you are in the VBA Editor and this 'compiles' your code and thus strips the spaces. You need to stop the cells recalculating while you are editing. Turning the calculation to manual in the spreadsheet.
Tools > Options > Calculation should do the trick.
I noticed this when I had cells recalculating thanks to a DDE connection.
There is sort of a way to turn off the auto-"correction" in the VBA Editor.
Tools Menu -> Options -> Editor Tab -> Clear the Auto Syntax Check box
Sadly, this won't solve all your problems, as the VBA Editor tends to have a mind of its own, for better or worse.
Taking it out of design mode fixes it every-time on vba2003 - its was driving me crazy at first ... i did notice it might have something to do with the web control but when i take it out of design mode it works fine ... just toggle that to get it to behave :)
I have had this same problem several times recently, and has driven me crazy.
After reading this post all the different fix-ups mentioned (none worked for me), I recalled I have been playing lately with Internet Explorer Control, opening Internet Explorer from VBA.
This is mentioned in some of the answers in this post.
This got me in the right path and, in order to fix it, I had to first delete all iexplore.exe instances (alt+control+delete), closed Excel and open excel again.
(iexplore.exe had been opened invisible from the VBA code, and I didn't know they were running)
That fixed the bug.
I have been programming quite heavily with VBA for over 4 years, and never had this problem.
Just a couple of weeks ago I started using IE control, and I started getting this problem...so in my case I can only assume the bug is directly related to the IE control.
I am running both excel 2003 and 2007 in same PC at the same time, and the problem only happens with excel 2007.
None of the above for me.
I had a Application.OnTime timer that fired every second and this triggered a recalculation of something: commenting it made my day.
This has started happening to me recently after adding a Timer event to an Access 2007 form. The VB editor "finalizes" the current line (as if you had moved the cursor off of the statement; I have auto syntax checking off) each time the event fires (initially I had it set to 1 second, now it is set to 5 seconds, and the behavior scales accordingly). In order for the event code to execute, the application has to ensure that it has been compiled. Presumably, the editor needs to be in a "sane" state to do this, as it probably has to check for code dependencies among modules. Note that the behavior occurs regardless of whether any dependent code is actually loaded into the editor at the time. Note also that resetting the execution state doesn't affect the timer event firing. As a practical matter, one could close the triggering form, switch it to design view, set a breakpoint in the triggered code, or increase the timer interval while working with the editor.
In contrast to abhishek's comment, changing the settings of Tools/Options.../General/Compile On Demand and/or Background Compile did not affect the issue.
If it helps, none of the previous answers solved mine. Only solution appeared to be to close the xls file and reopen it. Frustrating to have to do every 30 mins but at least it works. Would love to know why it's recompiling and cleaning the text... should really be an option to disable the text cleanup but couldn't find it.
Turn off Tools > Options > General > Background Compile. This solved it for me.
This is a long standing problem that could have various causes. I had this same issue occur in the Access VBE (so naturally the Excel answers weren't relevant). After a LOT of digging I finally got it fixed with the solution below. First a recap though:
If you are here because of this issue in Excel, try the solutions above first. To summarize:
The most common issue in Excel is that the Design button is toggled. Toggle that and see if the behavior changes as submitted by Dmitry Frenkel above
If that doesn't work, check for the "Load Test Report" AddIn as mentioned by Ade.
Those are really the two main causes in Excel, but if neither of those solutions work, then scroll through the rest of the solutions here. All are valid possibilities for the cause. In Access the cause is pretty straight forward. It's a timer issue on a form somewhere. I found this solution from here by User Kevin K. Sullivan.
Copy the following line of code onto the clipboard. (You might need to
paste it into a text editor first and coerce it onto one line, depending on
your newsreader. It must be one line.)
For i = 0 to Forms.Count -1: Debug.Print Forms(i).Name, Forms(i).TimerInterval: Next i
Switch to Access.
Press Ctrl-G to go to the Immediate Window.
Press Ctrl-V to paste in the code.
Press enter to to run the code. All open forms will be listed. Any non-zero timer intervals are your culprits. Simply close that form (It may be invisibly open from another process than the one you thought you were dealing with).
I think the solution for Access here is what the user Dom was trying to say above. I guess the down votes were because it wasn't explained very well and/or because he was speaking of Access when the OG issue was in Excel. Regardless, he is likely on point if you are here because of the VBE in Access.
I hope this helps people. I know I kept finding this page when researching this issue, so that's why I thought I'd update this solution here.
I hit this problem today on a fresh install of Excel 2010 Beta 2. None of the above made any difference, but going into the trust center and disabling all application add-ins fixed the problem for me.
I have Office 2010 Pro and I had the same issue. As I type the space between each word was being deleted. After trying each of the options turning them on and off the only way I found working was to disable the Winzip Courie(excel) add-in. This is done thru the Options dialog box Add-Ins section.
In office 365 I had the same issue - what worked for me is I saved the file with a different name and when I re-opened the new file the problem went away.
I found this issue pops up when I had AutoSave on. Turning that off let me code without it compiling every second.
I don't think I've ever seen the VBE remove a space when I've stopped typing. It will remove trailling spaces from lines if you move to another line, but that's something different and not behaviour that I think can be altered.
The removal of spaces in the VBA editor for Access occurs when a form is open in Form("Execute") mode. This is probably due to background executions based on "On Timer" methods. Close the form in Access solves the problem in VBA.

Resources