Opening Insert Hyperlink in Excel 2010 in a Specific Folder - excel

We're having a problem with the Insert Hyperlink problem taking forever to populate because of a ton of files in a network folder (Windows 7, xp was fine... oh the good old days. And yes, I've tried everything, disabling search, different reg entries, etc... and I'd like a different and less hacky solution.)
What I'm looking for is a macro that prompts for a number (in this case a client file number), and then opens the Insert Hyperlink dialogue inside a specific folder (for example, the file number the user enters might be 4321, and then the insert hyperlink dialogue would be opened inside the folder z:\clients\4321\ It's the z:\clients folder that has a stupid number of folders in it)
The actual file that would be hyperlinked would be somewhere inside there, so additional browsing would have to be done by the user. And I'm not sure exactly how the macro would behave in so far as knowing what to hyperlink (presumably the current cell would make sense to me).
Thanks for any help you can provide!

... You may have to play around with it a bit, but your best bet is probably to set the Hyperlink Base for each user's sheet and then set relative hyperlinks in the sheet itself.
Hope this helps...

Related

Excel VBA: Export workbook without links to external data/convert formulas to its values

I have come to a problem that I had kind of sorted, but it came back to haunt me.
I have a set of Excel files with information (origin) that feed an aggregator/wrangler/chewer in Excel (workbook) and then I have a set of files, one for each subsidiary (output), that have the same structure (sheets, hyperlinks, headers) but only get the relevant info for that subsidiary.
Right now I have everything automated, I download, prepare the information and update the origin files, then the only thing I need to do is open and save all the other documents (aggregator/subsidiary exports) and I do it with VBA.
In order to distribute the subsidiary files I have to come up with something that can have the same structure as an Excel workbook, but doesn't have the links to the aggregator, or the subsidiaries won't be able to see the information as there will be #REF errors everywhere (even on some sheets headers).
The solution that I put in place was exporting the files as MHTML (Single File Web Page), as it managed to keep the sheets and hyperlinks and everything as intended, while only needing to "open [subsidiary file].xlsx & save as [subsidiary file].mht", but then I came to learn that it is only possible to open this file type in IE, which not everyone has access to.
Then my problem is that I need an alternative to this solution while using only "plain" solutions as the IT department won't allow me to use anything more than standard administrative tools (standard MS Office suite).
I tried to replicate the subsidiary files by copying and pasting every sheet, but then I cannot come up with a way to keep every formatting (mainly header width) as intended when pasting as "values", or as "values and source formatting", and this approach doesn't escalate well.
Do you know of a way of saving the file as is but without the formulas, or preventing them from updating when the file reopens (even if you say no to "update links" prompt sometimes some cells ate updated, don't know why), or some different approach?
The idea is to generate a file that no matter who the user is, and does, is able to see the information, and cannot screw the file/info in it, and if possible keeping it "easy" to update with a "simple" macro.
Kind regards,
Flávio

Cell references/formulas in Excel to other workbooks on Sharepoint don't update values

The problem
I have eight Excel documents that are stored on a Sharepoint site. One of those documents (“receiving file”) contains formulas/cell references to the other seven documents (“source files”) on Sharepoint.
Everything works when the references are created.
Once the workbooks are saved and closed and then reopened, the receiving file no longer updates the values from the source files.
The files are synced in Windows Explorer and opened in the desktop version of Excel. Also, all eight files are opened at the same time.
The reference will first look something like this
='[Source file.xlsx]Sheet1'!$A$1
After closing and reopening, the references will look like this
='https://somecompanyname.sharepoint.com/sites/SitefortestingExcelreferences/Shared Documents/[Source file.xlsx]Sheet1'!$A$1
If I now change a value in the source value, the change will not appear in the receiving file.
What I tried so far
Setting “Calculation” to “Automatic.
Click “Calculate Now” and “Calculate Sheet”.
Double-click into the cell with the reference and hit enter.
In “Data > Queries & Connections” click “Refresh all”
In “Data > Queries & Connections > Edit Link” I clicked on update values. It did not help. However, I tried to rebuild a simple system with just two files and a single reference, and here it did work
Starting from point 5) I programmed a little macro that updates all links in all open workbooks (it did not help either):
Option Explicit
Sub UpdateAllConnections()
Dim wbWorkbook As Workbook
For Each wbWorkbook In Application.Workbooks
wbWorkbook.UpdateLink Name:=wbWorkbook.LinkSources, Type:=xlExcelLinks
Next wbWorkbook
MsgBox "Update complete.", vbInformation, "Complete"
End Sub
If I remove the path to SharePoint, so the formula looks like this
='[Source file.xlsx]Sheet1'!$A$1
It works again (until I save and reopen).
I found the following on Microsoft Answers (about OneDrive but it's probably the same issue):
https://answers.microsoft.com/en-us/msoffice/forum/all/excel-value-links-not-updating-on-onedrive/e48a7680-71e6-4a77-9eb1-e03ec7f0e3e0
I contacted the official O365 support desk and they told me this is built into the connection between Excel and OneDrive.
They have received thousands of complaints and there is no fix for it.
No option to tell Excel/Office/OneDrive to link to local copies of files on 1D by default.
No fix is planned as this is not how MS envisions how Excel/1D should be used.
My question
Any suggestions? Are there any tools in Excel that can be used to update the linked cells automatically or manually? Might SharePoint settings prevent the update?
If not, since removing the file path to SharePoint seems to work is there a way (using VBA) to remove the full file path from all cell references, so
='https://somecompanyname.sharepoint.com/sites/SitefortestingExcelreferences/Shared Documents/[Source file.xlsx]Sheet1'!$A$1
becomes
='[Source file.xlsx]Sheet1'!$A$1
I could probably loop through all cells and simply replace the path with nothing, but that would only work if I know the file path beforehand and if all the files are stored in the same SharePoint folder.
I had the same issue and here is my workaround: I can open the source file on the Sharepoint site by clicking ... and then Open in App (as opposed to Open in Browser) The referecence cell in the receiving file will become ='[Source file.xlsx]Sheet1'!$A$1 again and get automatically updated.
My workaround would be to consolidate external links onto a single sheet, and manually or use a macro to copy / hard paste to another identical page that you use for the links.
Just run the macro when you have the workbook open on your desktop to update the values.
Even simpler, you could also have a sort of database with linked values in a column and hard copies pasted into another column. This would be simpler than two identically sized sheets.
BUT, you could also go crazy and have named ranges like quarterly_total_formula and an analogue somewhere else called quarterly_total_valueonly and then write a macro to iterate over each with a for each looking for things "LIKE" *_formula and hard paste each result into the complementary *_valueonly spot... but then you'd need a macro to check that they were all paired... and by that point you might as well not waste your time in Excel and develop in Power BI, Tableau, RMarkdown, or heck learn Adobe Illustrator or work directly in HTML.

Excel Connections - Edit Links Not Working?

I do not know if this has been asked elsewhere but I looked and googled around for 30 mins and couldn't seem to find much. I have an old file with some drop down boxes for certain cells in an excel spreadsheet. I never really know how it works to be honest, and there are no macros within this sheet. But somehow, there are some links between some cells within the same file.
I recently changed file names and made copies to this master file, but some of the newer copies drop down boxes no longer work, and seems to be wanting to get to the original file. I tried editing this/these link(s) under the ribbon interface using 2016 - Data > Edit Links (under connections), and it brings up a pretty dialogue box, which has this change source button. But after I clicked it and selected the correct file (it's a circular reference, so it is the current file), it simply did nothing and did not update the file name or anything else shown within the dialogue box. And of course, my links are not fixed and the drop down boxes are not working.
I have uploaded the file here with all data stripped out, but the links are still intact there for your review. Any suggestions why I am seeing this? If I want to fix the links, what can I do to achieve that without fixing each of the cells individually? Thanks!
The file is here:
https://drive.google.com/open?id=1Sn27jnQmYvqWHho6Oa0yz7PXVGU4zwPJ
These reason you're seeing these links is that there are cells with Data Validation that point to an external file (cell B71, for example).
Remove all Data Validation that is referencing external files, save the file, and re-open. The links should be gone.

how do I get the link name from Excel or VBA

I'd like to have my spreadsheet behave differently depending on how I call it.
From file explorer I can double click on either "UHF-test.xlsm" or its shortcut, "VHF-test.lnk". From VBA or an Excel formula, how do I determine which one was used?
If I can't determine the link name, is there another way to pass information in the command line, something like this BAT file
start "\B" EXCEL \\qcy-win10-it-2\TDS-repository\TDS-UAXTED.xlsm -VHF
The BAT file solution works fairly well, it's a very small file where I can embed some options for running macros. A small downside is that the Excel PATH is not normally in the system execution PATH and needs to be added.
The goal is toI write and maintain one only macro-enabled spreadsheet stored in a network location but with the ability to allow multiple users to use it with different products and parameters without being prompted by a macro on startup.
I still prefer determining the shortcut name if someone has that solution.

Multi-user sharing excel files and automated refresh

Any recommendation on having a shared excel file auto-refresh itself?
We will need 3 users of an excel file on the fileserver. One user will be making changes. Others are read-only, but they must see the change as quickly as possible. Any pointers on how to do this?
In your excel file you need to enable workbook sharing (in 2007 it's the Review Ribbon, Share Workbook). On the advanced tab you can set the "Update changes" to an interval as low as 5 minutes and set it to "Just see other users' changes".
Jesse
Not sure if anyone is still interested in this but there are far more sophisticated tools to do this now.
Checkout https://www.ipushpull.com
Disclaimer (just so I don't get too much hate): I am affiliated with ipushpull
Depends on what server tools you're working with.
If it's just a shared excel file on a server, if one user has it open others will only be allowed to open a read only version, regardless of what their permissions are. When the first user saves their changes, other users can view the updates by reopening the file (again, in read only mode if the first user still has the file open, and/or if their permissions are set to read only).
If you're on a system like sharepoint you can do the kinds of things you're looking for.
This may help:
http://office.microsoft.com/en-us/excel-help/overview-of-sharing-and-collaborating-on-excel-data-HA010089896.aspx
Save main excel file (A) on the server and give access to editor so that he can edit. Copy same file and name it (B) and link it to main file (A) to read data and protect. You can do this simply by referencing respective cells to main file. Distribute copies of file (B) to users to read the data.
How to link?: Open both files on your PC, in file (B) Sheet-1 click in Cell A1, type = and go to File (A) Sheet-1 and click in Cell A1. In formula bar if cell reference is absolute ('[(A).xlsx]Sheet1'!$A$1) change it to normal ('[(A).xlsx]Sheet1'!A1) by hitting F4 3 times. and hit Enter. Cell A1 in File (B) has been linked to respective cell in main file (A).
Now select cell A1 in file (B) and drag it towards last required cell on right then select line 1 and drag downwards as required. Now the whole page is linked back to your file (A). Similarly do for other sheets. Any changes done on file (A) will reflect in File (B) in real time if both are open, otherwise on reopening file (B) you will be asked to update, click yes and that is it. Hope this helps.

Resources