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

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.

Related

How can I load edge and get info from a text file in VBA?

I’m currently trying to write a macro to pull information from a website and then display it in a worksheet. So far, I have code that will open Edge and navigate to the required URL. The user has to login using their CAC certificate, and then it goes to the correct page.
Dim browser
browser = Shell(EDGE_PATH & URL, 1)
Once the page is loaded, it submits the form which creates a new window with a text file that has the needed information. I need to get the information from that text file, but I’m not sure how to do it with VBA or shell. If it’s even possible. I know of Selenium, but I can’t use that in this environment.
Does anyone know of a way to do this? Any information would be appreciated.

Exporting WebBrowser to PDF with userform or in spreadsheet

I am implementing a feature to my excel-program that will show me a map (from google maps) of some coordinates. The idea is to be able to export this map with other pages to PDF. It looks like I have two options:
1) Inserting a ActiveX "Microsoft Web-Browser" directly in to the worksheet and then having excel export said worksheet to a PDF.
2) Inserting a ActiveX "Microsoft Web-Browser" in a userform.
My problem for 1) is that it doesn't seem to work for newer version of excel (2013>), but it does work for Excel 2007.
The problem with 2) is that it is hard to export a userform to PDF when you also want 2 different pages from the workbook in the same PDF (I do not know if userform1.printform has that feature).
My question is if there is either a way to insert a Web-Browser directly in Excel, for all versions of excel, or a way for a macro to export both worksheets and userform in the same PDF.
I suggest the legal way number 3) Using the Google Maps Static API to download a map as image to a temporary folder and import that image (dynamically) into your Excel file. Then you can export that Excel file to PDF as usual.
The Maps Static API service creates your map based on URL parameters sent through a standard HTTP request and returns the map as an image you can display on your web page.
This means you can download the image file through a standard HTTP request to your computer and place it into Excel.
I'm pretty sure the ways you try to automate it is against Google's terms of use because automated access of Google's services without using the official API is probably not allowed, no matter if private or commerial use (you might get banned).

Excel 2007 Refresh Imported CSV File From Web

Log data from a test is uploaded to a web service, and the processed CSV is downloaded back into Excel for viewing in charts. At the moment, this is done via copy and paste for short CSV files and the Data > From Text feature for larger CSV files. Unfortunately, this takes a bunch of time for every test, and I need to make the process very simple for someone else to update the Excel spreadsheet.
The Excel spreadsheet contains 5 raw-data pages which are used to store the CSV from the server. I have no issues selecting Data > From Text, entering the website URL, and completing the format to import. This process can be repeated (same as the Copy and Paste) for all 5 pages to import the data.
This process only allows me to put in one filename, so I am using the same URL for the data, and having PHP return the CSV of the latest (or a specifically configured) test whenever the website is accessed. I've verified that this process is working correctly.
Unfortunately, when I do 'Refresh All', it prompts for a filename unless I go to Data > Connections > Properties, and uncheck 'Prompt for file name on refresh'.
However, even when I do that, I'm getting mixed results. Sometimes only one of the pages will update. (Seems to be the last one I set up.) Sometimes none of them do. I need a solution which updates all 5 pages based on the current CSV from the server without having to set up the connections again every time. Ideally I'd like to just hide these raw data sheets so we can have an Excel file that's just the final charts.
Surely this is a common function and I am doing something wrong, yet all the guides I try on the Internet don't seem to work. For example, this one:
http://www.kimgentes.com/worshiptech-web-tools-page/2010/8/18/web-connecting-csv-files-as-external-data-to-excel-spreadshe.html [URL is corrected]
Seems like they only set up one connection. I can get one working to refresh, but not more than one.
I have seen this happen and finally figured it out. There are actually 3 things that can happen to give this result, and a separate solution for each:
First, Excel software uses the IE 11 web object to when it does web
retrieval of data. This means it will be "sticky" to sessions using
IE11 to access the data. Most websites these days are run by cloud
servers, which generate sessions on the server with the most load.
This normally has no impact on users on web browsers since they
login and can visually enter their credentials etc. But when a
program accesses a website and must use a specific web browser, it
must use the properties of that browser and how it works. I ran into
this a lot when I would generate and be able to download my CSV
files on the website in Chrome, then try to use Excel to import the
same files wouldn't work (it would say they weren't there). The
solution to this, at least for now, is to use IE 11, login to the
website, generate the CSV files and test that they can be
downloaded. Then use Excel to run the web import and it should pick
up the same sticky session to get the CSV files.
Second, password entry is a different thing, but also has to do with the stickiness
of the data. For some reason Excel will not cache your credential
responses for logging into a website without you entering them 3
times. This experience may change for you, but I found that I must
enter a new credential set (for a new web import of a CSV) 3 times
before it becomes permanently cached by Excel. After this, I don't
have the problem.
Third, most complex Excel programs that require
web import may also require that you either import local data you
downloaded from a website, import data from a website into a sheet
or run more complex objects like Macros. All of these need proper
permissions. You may need to set your Trust Center settings to allow
you to use your Excel program on your computer in this way. That is
part of MS office. You can set add and update those as per MS info
here:
https://support.microsoft.com/en-us/office/add-remove-or-change-a-trusted-location-7ee1cdc2-483e-4cbb-bcb3-4e7c67147fb4

Exporting data to existing Excel file

I have a system with an Excel spreadsheet template file which is used for invoicing. I would like the user to be able to click a button on an Xpage, which will then open the spreadsheet and enter the latest invoicing data in Excel. I don't mind if Excel is either the application on their machine or on the server, but my preference would be the application locally on their machine.
I've looked into Xagents, as I feel this is probably the answer. I know they can be used to create Excel but I have not been able to locate any mention of opening an Excel file, and entering data into specific cells.
Is this possible?
EDIT: you can use Apache POI for editing and creating Microsoft Office documents. This is a java project which gives you a handle to office documents and this can be used using java.
A good starting point can be the blog of Christian Guedemann from webgate:
http://guedebyte.wordpress.com/2012/09/17/documents-and-spreadsheets-with-xpages-building-the-kernel-part-ii/
(end of edit)
The only way I KNOW and tried to write data from Notes to Excel is exporting the data to an HTML page and setting the Content Type accordingly (e. g. as described here (there are a lot more resources available for taht):
http://www.dominoguru.com/pages/developer2010_xpagexlsexport.html
I am not sure if this is of help but it seems that this project can help you:
http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=ZK%20Spreadsheet%20for%20XPages
As far as I can see this project can load Excel files from XPages - and then it should also be possible to edit the files.
Besides that the only solution I can think of is a Notes Agent that is called from the XPage. This agent can then run in background and do all the excel stuff. After running, the XPage can show a link to the Excel file. Actually this is the solution I would consider to implement - but maybe others step in with better answers here.
You don't want to introduce a dependency on Excel in your application -- wouldn't work with an iPad front-end. Rather have a look at the ZK Spreadsheet, it will fulfill your needs.
However if you have to have Excel, then you need a roundtrip solution: load the Excel from an URL (probably generated by an XAgent (?) and save it back. The saving back part is the tricky one. Normal HTTP doesn't allow that. What you need there is a webDAV capable server. Watch out for a project on OpenNTF soon (just clearing IBM legal) that provides webDAV.
However the ZK Spreadsheet looks much better for your needs.
I have a sample database at the following URL --> http://www.nnsu.com/nnsusite.nsf/%24%24OpenDominoDocument.xsp?documentId=B65507CB2DE15B3286257986005F061D&action=openDocument
Download the APCC.nsf. This will allow you to create/read a new EXCEL spreadsheet and then stream the resulting file to the requesting browser. There is not need to have EXCEL or office installed on the Server.
THe examples create a new workbook, but you can also store a "template" on the server or in a notes document and use it as a starting point and then save it to a document or stream it to the requesting browser.
With Apache POI you can read/write to a spreadsheet using data from the notes document the process is initiated from.

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

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.

Resources