Excel form lost path - excel

In my file server, some excel files lost their path,
Example:
=if(A2='\\172.168.1.1\SHARING\LANAIM\Gest_Qual\05__REG\04__Gest\[file1.xlsx]data'!$A2;2;False)
what happens and stay that way:
=if(A2='\\172.168.1.1\04__Gest\[file1.xlsx]data'!$A2;2;False)
How can I solve this problem? if someone can help me.
Thank you

You could have a hidden (or not) worksheet with the names of the files that it is to link to. Then use a VLOOKUP to handle the names. That way you can changes the file names in the lookup table and the links will redirect as needed.
Someone may have answered "yes" to update the links as some point and that caused them to change.
----EDIT----
I just thought of something:
Rename \172.168.1.1\SHARING\LANAIM\Gest_Qual\05_REG\04_Gest\ file1.xlsx
to file2.xlsx
Open \172.168.1.1\04__Gest\ file1.xlsx (Create it there if it does
not exist)
Open the file that has the links in it.
Verify that changes to file1.xslx appear in the linked file
You should now have 2 files open (the linked file and the dummy file1.xslx).
Use "Save As" to save file1.xlsx to the location that you want the links to point to (\172.168.1.1\SHARING\LANAIM\Gest_Qual\05_REG\04_Gest\ file1.xlsx).
Close file1.xlsx then close the linked file.
Rename \172.168.1.1\SHARING\LANAIM\Gest_Qual\05_REG\04_Gest\ file2.xlsx
back to original file1.xlsl (deleting the dummy file1.xslx in the process).
Open your linked file and the links should now point to the correct
file1.xslx.

Related

How to open a file from an absolute path without having to save a copy

So we have our local website to navigate through our drive :
showcase of the website
Here, each button is a link to something on our drive
One of which is a link to a Excel file :
showcase of that specific link
Now, that Excel file contains relative links to PDFs : Relative links inside an Excel
If we click on that button linked to that Excel file from Edge (2nd screen), a prompt appears asking if we want to "Open" the file or "Save as", but the issue is... if we choose "Save as", obviously the links inside that Excel file wont work (unless we save it at the same location), so that's totally normal, the correct option would be to "Open" it.
The problem is that opening a file from Edge... actually doesn't open a file at all, it saves it locally under the AppData path of our machine and THEN opens it.
That means even in that case, the paths inside our Excel file wont work either because they are relative.
I know one solution would be to change all links to absolute links inside that Excel file, but that is a tedious work (because there are a LOT of links, we would have to create a script or something to do that).
So my question is, is there any way to directly open that Excel file from the path specified in the button's link, instead of saving it first locally under "C:\Users\XX\AppData\Local\Temp\MicrosoftEdgeDownloads\f02875af-f436-47bb-b7e5-f3caa96df03f" ?
This is not an issue when using Internet Explorer.
Thank you in advance for any help.
Kind regards,
If you want to allow intranet zone file URL links from Microsoft Edge to open in Windows File Explorer, you can try this Edge policy: IntranetFileLinksEnabled.
Otherwise I don't recommend you to do this, based on the security issues already mentioned.

Manage external data source locations in Excel when sharing the file across Dropbox

When working in Excel, sometimes we have external data sources.
In Windows, these files may be stored in a specific location such as C:\Users\Freelensia\Dropbox\data source.xls
When sharing the main file and the data source file with another person through file-sharing services such as Dropbox, the location of the data source will be changed to:
C:\Users\PeterSmith\Dropbox\data source.xls
(from the view of the Peter Smith user)
This will break the data connection in the main file when Peter opens it. He can reset the path to the one as seen from his computer, but that will break the connection for the Freelensia user when he/she opens it from his/her end.
Is there a way to permanently fix these locations for multiple users? Such that Excel will correctly get the path when the right user opens it.
I am looking for an inherent Excel property if such a thing exists. Else VBA macros (A table with the file paths for each user, and MsgBox that ask the user to choose the user profile). Else a Windows .bat file could work as well.
Thank you for your help.
A trick to this is to move your Dropbox to C:\Dropbox for all users.
To do that, click on the Dropbox icon at the bottom-right, click the Gear Icon, Settings, Sync Tab, then you can move the folder to C:\Dropbox.
If you encounter permission errors, follow the instructions here to reset the permissions:
https://www.dropbox.com/help/desktop-web/move-dropbox-folder
If my understanding is right when ever a different user opens/saves a file the path "C:\Users\xxxxxxx\Dropbox\data source.xls" will be same only "xxxxxxx" in the path will be varying with the active user who has logged in.
So use "Application.UserName" function to get the username and use it in the path mentioned above
Excel uses relative links, even though it shows longer paths in the cells when you look at them. This ends up meaning that if you move the file and the file(s) it is connecting to a different location then the links will still work.
If you put your main file in Dropbox\Excel\main.xlsx and then your data sources in Dropbox\Excel\Data\data sources.xlsx then I think you should be good.
I tested this with Google Drive on two different computers, taking turns opening and modifying the data source and also opening and having the main file update without any issues.
I am not positive if this would work for you in Dropbox, but I really think it should... I am using Excel 2010, so if you are using Excel 2003 (or saving files as .xls instead of the newer .xlsx format) there is a possibility that could cause issues.

Using Directories in Excel

I'm trying to get some data out of excel files. Never used excel before but I understand VB. So I have a file with a button my boss implemented as well as his code he used. Here is the code:
(you can see the "Get Data" button in there)
My exact problem is that I don't know a lot about excel so if someone could help me figure out what is going on as well as figuring out how to correctly use directories that would be awesome! For more context when you click the button it gets all files in the directory and then the user clicks a file then excel follows a macro to get some data out of sed file.
Right now it returns nothing but there is 5 files in that directory?
Here is what the default directory looks like after edit:
And here is the files in my directory:
As #Tim Williams says ... Insert the back slash after the folder name
DirNow = Dir(Range("DefaultDirectory") + "\WFP*", vbDirectory)
EDIT
Basic troublseshooting
Does it it compile?
Looks like "UserFormDataa" - should maybe be "UserFormData"
Add Debug.Print DirNow after it's set and show us the display
If that's not right add line
Debug.Print Range("DefaultDirectory") to makes sure range is defined properly
Remove vbDirectory - unless you're going to handle processing files under the matching sub-folders
You are missing the terminal backslash on your default directory.
C:\Users\CUCCOMTT\Desktop\Excel Project\
Otherwise you're looking for files named
C:\Users\CUCCOMTT\Desktop\Excel ProjectWFP

External Links not auto-updating when Source File is OPEN

I have a very odd occurrence happening. Linked data in a Master workbook is not updating when one of its source files are open. I have a Master workbook that has links to about two-dozen source workbooks. The links work properly when I open the Master file. However, if I open both the Master workbook and one of the source files and proceed to change one of the inputs from the source file, the update does not flow through to the Master file.
If I then save the source file and click Edit Links >> Update Values in the Connections section of the Data tab of the Master workbook, the data updates. I don't want to have to perform this manual "push" every time I update the source.
The only symptom I can find is that the reference to the source file in the Master file does not become an internal reference when the source workbook is open. It retains the entire file path (i.e. 'C:\shared\username\folder[filename.xlsm]sourcedata'!$D$3) instead of simply beginning with the bracketed expression ([filename.xlsm]sourcedata!$D$3).
Using Excel 2013.
This is only happening on my machine. I tried it on two other machines and the links work properly.
I have checked my calculation settings to automatic, and have Trust-Center set to the most permissive setting possible. I have automatic updating of links turned on. This workbook is password protected for EDITING (it can be viewed without a password).
Please help!!
This sounds like an issue I once had, I suggest you to try changing the file path syntax to UNC convention, i.e. instead of C:\shared\username\folder[filename.xlsm]sourcedata'!$D$3 something like: \\\ComputerName\C$\shared\username\folder[filename.xlsm]sourcedata'!$D$3
That sometimes helps

Recover unsaved .csv file changes

Does anyone know a way to recover changes made in a .csv that were not saved when excel 2007 was closed.
At the moment, I don't see any way to solve this.
Check all the temporary files created recently. Especially alongside the file you opened. There are a few temp folders in the system that Excel may use. C:\Windows\temp is the main one, but it is usually under the Users folder in later versions of windows. Eg: C:\Users\YourUserName\Local Settings\Temp
If you find any files that look like Excel temps, take a copy and rename the extension and then try to open it.
(Your only real chance is if auto-save kicked in and saved a copy - to a temp file - when you still had your new changes in the document. Otherwise the changes are lost I'm afraid)
If option #1 doesn't resolve your problem in Excel, go to File->Options->Save. Hopefully your AutoRecover file location, under the third box, will be populated with an address.

Resources