How can I stop Excel 2003 from hanging after opening a spreadsheet in IE? - excel

I have a web application which provides Excel files via IE 7. It requests the files with an HTTP GET from a URL which returns the data with a content type of 'application/vnd.ms-excel'. It then opens the spreadsheets in an IFrame.
This all works fine unless Excel is already open when a spreadsheet is downloaded. In this case it is still displayed correctly but reuses the instance of Excel which is open. When the IFrame is closed, Excel hangs. Excel only becomes unlocked if the user logs out of the web application or if they download a file of a different type.
I've tried turning on the 'Ignore other applications' setting under Tools | Options | General but it didn't solve the problem.
I've also tried following the steps in this answer (as the linked reference says 'This issue has been addressed in Excel 2007 beta 2.') with no luck.
Is there some kind of 'disposal' step which I'm not currently doing which would prevent Excel from hanging?
Versions:
Excel 2003 (11.8220.8221) SP3
IE 7.0.5730.11 (Update Versions: 0)

Not sure if this helps but ...
I had some similar problem (generating CSV content on the fly) long time ago and all I can remember is that it had to do something with right Response methods being called. The code was something like this
Response.Clear();
Response.Buffer = true;
Response.AppendHeader("Content-Disposition", "attachment; filename=export.csv");
Response.Cache.SetCacheability(HttpCacheability.Private);
Response.Cache.SetExpires(DateTime.MinValue);
Response.Cache.SetLastModified(DateTime.Now);
Response.Cache.SetMaxAge(new TimeSpan(1));
Response.ContentType = "text/csv";
Response.ContentEncoding = System.Text.Encoding.Unicode;
...
//Some writing to the Response.OutputStream
...
Response.Flush();
//I am not sure about the following line:
Response.End();

Further to Robert's answer, the following line of (Java) code fixes this problem, in that it prevents Excel from hanging:
response.setHeader("Content-Disposition",
"attachment; filename=\"" + filename + "\"");
[NB 'response' is an HttpServletResponse]
However, it forces the spreadsheet to be loaded into an Excel window rather than being displayed in the IFrame...
Update: Resetting the URL of the IFrame to blank forces the Excel instance to be disposed and fixes this problem (without requiring the Content-Disposition change).

Unfortunately, this is completely out of your hands. It really depends on what version of excel they have and what updates have been applied.

Have you been able to reproduce this issue in your own environment? If not, it may be an issue on the client's computer. Is there any way you can find out what options were or werent installed, or if Excel has been maintained with it's patches?
It seems to me that office itself needs to be re-installed, if not IE 7 after that.
I would also look into any iFrame closing issues. To test this theory out, you could post the iframe to a new page (without iframes) and then link back to a page with iframes and the excel file? I realize that probably wont' be a working solution for you, but it should help you eliminate whether it's excel, IE7 or the iframe code having a bug.

Is this something you're able to reproduce, or is it something being reported to you by a customer, and you're trying to hunt it down?
The link you've provided deals with multiple monitors - I have multiple monitors as well when I dock my laptop, and I've found a number of applications don't respond well. For example, if an application attempts to open a modal dialog box in a desktop space that doesn't exist anymore (for example, on my "second monitor" after I'veundocked my laptop), it will lock up the application since I can't get to the box. Could that be what's happening here?
Another potential problem happens if you're asking the user for some kind of authentication when they get the Excel file. On our sharepoint site, Excel wants the user to authenticate, and if that modal authentication dialog somehow gets pushed into the background, it can be impossible to get to the front again. The only way is if you kill the process or if you close the sharepoint browser, since that terminates the request for the file in the first place.
Hope this helps, and if either of these give you some more clues, post them here and we'll get this solved.

Related

User unable to open or save workbook with VBA code

This has me stumped. The user is able to work with workbooks containing the same code that were produced previously. Just recently new workbooks with the same code in them cannot be opened or saved. There are a range of error messages depending on where the workbook is opened from - we have tried safe locations, local folders and Dropbox folders. We have also tried with code signed and unsigned workbooks.
Error messages include:
'Excel cannot open the file Test.xslm because the file format or extension is not valid...' (not true, as I can open the same workbook and run the code without problem).
'Your changes to Text.xlsm could not be saved due to a sharing violation...' (followed by more errors to do with not finding a temporary document).
I have also tried removing ActiveX references which might flag as a security issue, (e.g. VBIDE) and commenting out blocks of code. No joy. Microsoft Defender reports no issues. There are no other antivirus programs running. There are no problems with the same workbooks with the VBA modules removed completely - so it definitely looks code related.
Anyone have any ideas?
This might be because of ASR.
If you check your "Windows Security" --> Virus & threat protection --> Protection history, you should find an event of "Risky action blocked" that shows your file has been "Blocked by: Attack surface reduction" Rule: Block Win32 API calls from Office macro".
I'm currently facing a very similar issue but I'm on the other side (I am the one that enabled ASR rules).
If that is the case for you as well, I wonder whether the problem depends on the identity that you use to save the file through your macro. Are you using the same security context of the user executing Excel?

Excel says a file is locked by 'another user' and removes macro when opening

I was hoping someone could kindly help me with this issue. I have never faced this before and I am not able to solve it.
We have an Excel file on the network, that up to 10 people daily use, with Excel 365. The file contains a macro that connect to SAP. Until 3 weeks ago, everything was ok, and has been ok for over 6 years.
Now, we hired a new team member, who was given a new PC.
When our new team member tries to open the file on her new machine, there is first a message mentioning there is a problem with the file and proposing to try to recover as much as we can (see picture 1).
Then when she chooses "Yes", she gets another error message mentioning that the file is locked by 'another user'. Oddly enough, it says 'another user', and not the name of that user, and we tested and are 100% nobody else is using the file.
If she then select "Notify" or "Read only", another message pops up, info message from SAP Analysis for Windows.
Finally after she clicks 'OK', the file gets finally opened, but all macro are removed from it. There is a message about the repair:
The log file is added at the end of this post.
We don't understand where the issue exactly is, this is what we tested:
the same new users recently hired can use the file with the macro without any issue on another machine
users that could use the file on their machine, can't on the new machine of our new colleague (for the test, they log in with their own credentials)
other macro files can be opened without any problem on the computer of our new colleague
we have fully reinstalled the computer, and still it bugs...
Log message:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error242560_01.xml</logFileName><summary>Errors were detected in file 'S:\MyDistriplus\DI SAP OPERATIONS\Création articles\Templates Création\TEst (2).xlsm'</summary><removedParts><removedPart>Removed Part: /xl/vbaProject.bin part. (Visual Basic for Applications (VBA))</removedPart></removedParts></recoveryLog>
The problem is with the machine (the new computer).
Although you've performed a clean installation (reinstalled), you probably installed the same (probably corrupted) version of Windows and Office.
Try to open OneDrive and change this setting:
Try to install the same version of Windows and Office that's installed on the rest of the computers.
Note: Make sure to include all needed apps, addons, and files to the problematic device.
I had a similar issue, although not the locked by another user dialog. Losing the VBA made no sense to me. It turned out my issue was from duplicating a sheet in VBA that contained an image.
I think I was creating a duplicate ListObject entry for the picture, which would crash excel. My solution was to duplicate the image separately.
If your code is duplicating sheets, try removing any ListObjects and see if the problem persists.

OBIEE 11 - Error while opening excel file downloaded on file system

I'm using a java method to download via agent my multipage dashboard to server file system. When I open the downloaded file I get an error "Excel found unreadable contente in "test.xlsx". Do you want to recover the contents of this workbook? If you trust the source of this workboos, click Yes."
When I click on Yes button, I have a warning "Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded."
Data are perfect, nothing is lost, but file is delivered to end users and I can't let it so.
I've tried the same on another environment, where OBIEE 12 is placed, and unfortunately I encounter the same trouble.
I really don't know what to do. We have installed the patch "11.1.1.7.181016" that promises to fix java security trouble in creating the excel file, but with fully unsuccess.
Any suggestion would be great and precious.
Thank you very much.
There's a reason that 11g is outdated and has been replaced with 12c which itself is already on the way out and being replaces by OAS.
The ancient versions have issues that aren't fixed anymore and something that came out in 2013 is expected to not work anymore with other modern software at some point.
It's way beyond time for you to upgrade. And fast. The longer you wait the more problems you incur.
Update: If the bundle patch and the one-off patch 22934699 don't solve the issue then you will be stuck with it.
Alternatively you can switch to CSV for the export since looking at this question here and your other one all you're doing is data dumping.

hyperlink in excel doesn't load properly, but from PDF or word loads fine

We have a Business Objects (BO) report, that formats a hyperlink to the front-end application for a particular entry; so that you can go straight to the data entry screens for that record in the report.
Link works properly from Business Objects in the browser.
Link works properly from a Word document saved from BO.
Link works properly from a PDF document saved from BO.
Opening the XLS file in OpenOffice Calc, links work fine.
Opening the XLS in Excel and the links fail, with an error message from the application as if the security was timed-out or the user hasn't logged into the application properly. (Which doesn't happen for any of the other non-browser based applications, if the application is open in another tab and the user is signed in.)
When the URL parts are copied out of any of the formats/applications, they match exactly. The application redirects to the error message page, so I can't say for certain what URL hits the browser from Excel, only the results. The other applications end up at the page listed in the href attribute.
Is there anything that can be done to alter the href part of the link, so that it works from Excel? (As a sub-question, any hints as to why Excel's hyperlink behavior is different from the other MS Office apps would be appreciated.)
My Google-Fu isn't strong enough with this one, most of what I've found with the keywords I've tried have been directions on how to link from Excel, not troubleshoot failed outcomes of an otherwise valid hyperlink.
Link general form (in case that matters): https://server.domain.com/path/page?parameters=uniqueID
Try changing the cell format to text. It has worked for me in the past when hyperlinks fail to work.

ms office file extensions

I made a discovery some time back. Just follow these steps:
Create a .doc/.xls/.ppt file in office 2003. Keep some test data in there and close the file. Now rename the file to change it's file extension to a random string, taking care that it is unassociated, like test.asdfghjkl etc.
Double click the file and it opens seamlessly in the parent application.
Now AFAIK, windows checks the file extension of the file and uses it to do an action, viz open an application and pass the file to it to open. Then how does the office suite manage to do this?
EDIT: How about the case when the extension is changed to one that is associated with another application. Is there a priority algorithm in place for handling that ?
Do you have the "View extensions for known types" option on?
EDIT: #Comments....
Yes, its a stupid/insulting question, but when troubleshooting a problem I have learned to assume nothing, and trust the users 0%.
BUT, I tried it, and you're right. Its stupid that MS has this kind of behavior, and it can only lead to security vulnerabilities, which led me on a search for your answer.
From the posts at http://seclists.org/fulldisclosure/2007/Jan/0444.html
"You have stumbled on an age-old
quirky behavior of Windows. Office
document formats are based on a
standard Windows container format, OLE
structured storage files, also known
as "docfiles". A docfile's name and
extension are irrelevant - the file
is, conceptually, a serialization of
an OLE object, and like all
serialization formats it contains the
identifier of the application that
produced it, in the form of an OLE
class id (in GUID format) in this
case. You can easily verify that it
doesn't work with the newer Office XML
formats"
Indeed it doesnt work for the 2007 *X file types, but 2K3 is still a problem. To solve this problem... Upgrade! =)
And here at security focus under TOC point 2.
So, there you go.
I can't seem to make this happen now, but I know I saw Windows reading XML processing instructions a few years back. Maybe that is what's going on?

Resources