Sharing an Excel File - excel

I wanted to get this community's feedback on best practices for sharing an Excel file.
I have an Excel file on a Sharepoint site where multiple people are responsible for updating the contents of the file. 3 options come to mind on how to handle this.
There could be a master file which has links to other Excel files, where each user could have their own unique slave version of the file. The user could then edit their slave version of the file and when the master is opened, the links in the master would get updated.
I can add multiple data connections to the master file, such that there is a connection for each slave file.
I've also read about making an Excel file shared, where multiple people can edit the same file at the same time. There seems to be a couple of drawback with this option.
a. The Excel file cannot reside on a Sharepoint site.
b. You are limited to the kinds of edits you can make to the shared Excel file. For instance, you cannot insert or delete blocks of cells. You cannot delete worksheets.
Perhaps there is a better option that I have not thought of. So, I'm throwing this out to the community to see what ideas come back. Thanks.

One approach you may consider is to use version control. By placing the Excel file in a shared library on SharePoint and turning version control on for that library (library settings->version settings) you will now have the ability to use "check in" and "check out". This helps ensure that one person's update is not erased when another person copies their updated file into the same library. In addition, this will also provide the ability to have minor and major versions. Only designated individuals can read/update the minor versions (i.e. editors, approvers, etc.) and major versions viewable only to all others with access to the library.
One other thing, you may need to turn on Publishing services for the site in order to have version control.

Related

Open Excel File from Command Line Unprotected View

I frequently open large excel files (100 MB+) from a network location that I completely trust. However, the default trusted domains on the workstation that I use does not include files on the network drive. It is cumbersome to load each excel file twice (once to open it from explorer, then again to 'enable editing', i.e. remove protected view).
Is there an argument/switch that can be provided to excel.exe from the command line that will force a file to be opened in unprotected(editable) view? I would find this less cumbersome than waiting for a large file to load twice.
I typically use Excel 2010 and 2013.
Note: I already know how to disable protected view through the excel interface, this is not the solution I am looking for, as these settings reset to their defaults everytime I log off the workstation.
I am also prepared to accept the fact that this might not be possible to do except in the Excel GUI. But if anyone has a workable solution, that would be brilliant. Thank you!
Is there an argument/switch that can be provided to excel.exe from the command line that will force a file to be opened in unprotected(editable) view?
No.
The protected view comes as a result of the level in the security settings, thus it would be a major security problem, if it can be avoided.
As a possible workaround - copy the files to your computer, mark it as trusted and open them there.

How to store macros in one file shared among several users? (not PERSONAL.xls)

I have a 20 excel files with Automation written in VBA where the workflow is similar but there is some customizations in each of the files. I would like to have 20 files, each file per task, but I would like to put all macros into one file, with all the customizations. This will simplify fixing/changing the automation.
I want to have basically one file GlobalMacros.xls somewhere in a shared drive which contains all the modules that do not contain customizations, and only have references to it in the proper files.
Personal.xls is not an answer as I do not want users/team members to feel the changes at all.
Please tell me if there is a solution and what are downsides.
Solution 1:
My solution is to make the module in GlobalMacro.xls and then add just a reference to the module in each file. The downside is it could slow down the execution of the macros because the GlobalMacros.xls will be opened and closed in the background each time any module is called out. Also is it possible for several users using these macros at the same time?
Has anyone got any better solutions? Maybe someone had a similar problem in the past.
I'll go into a bit more detail about how to use XLAM files properly.
In a network environment, you will want to keep a local copy of the XLAM where you make changes and updates, and once all glitches are worked out, you then copy it to the server where everyone else accesses it. You will want to also make the server copy read-only, which must be reset each time you copy the file to the server. If you dont make it read-only, you will not be able to copy the updated file to the server while anyone has Excel currently open.
In addition, when the users add the Add-On to their Excel, they will be prompted to copy the XLAM file to their local computer, to which they should reply No, as they want to be able to run off the server copy so they can get your updates. I have found that most people instinctively think they should answer Yes to that question.
If they end up answering Yes, then the only way to fix it is to edit thier registry and remove the reference, and then re-add the Add-On.

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.

How could Visual Studio 2012 be set to use a custom tool to customise the Reading/writing of existing editors?

Update: It appears that VS doesn't have the hooks needed to do what is needed in my use case. However there are a couple of options that could work for other people and as such I'm marking the question as answered but I would love to find a solution that works for me.
We have encrypted files that are routinely kept in encrypted form within source control (TFS). When I want to compare versions I use Beyond Compare and have added the encryption/decryption tool as filtering on the read/write process to allow plain text viewing and editing.
However if I just want to open the file for reading/editing it's a bit tedious using a dummy comparison just to view/edit the file.
As such as I wondering if there is a configuration setting or way in Visual Studio that would allow me to insert a filter on the read/write so that it could display/edit/save files that would otherwise be unreadable.
Edit:
*NB: The encryption aspect is just single use case *, I'm actually looking for a generic answer that doesn't require writing an editor to replace the editors within VS that already exist such as the MS supplied XML editor or the custom third party ones.
I have both custom and non custom files that are encrypted. Each file type already has an editor. We have no access to the source for any of these editors. The problem is that the file is encrypted in TFS, and all I need is the filtering on the read and write for all files regardless of editor.
I want to use all the existing features of the installed editors without change. Only the reading and writing need to be customised.
Here's a potentially hacky way to achieve what you are trying to do, if there is no other easy option.
TFS stores data in a SQL database. Therefore you can theoretically modify the read/edit command that is used to extract the data from TFS and send it to the editor/viewer. This might involve modifying a stored procedure, or putting a trigger in place to modify the data before it is presented to the editor.
You would need to run a Profiler Trace on the TFS database when you click on edit/view or browse to the node in the source control tree. This will help you to figure out what data TFS is accessing and what functions/stored procs/tables etc it used to extract said data.
The same in reverse; you'd need to modify the 'writing' of the data to use your custom tool before putting it in the DB.
SQL has the ability to call CLR code, so you could use your tool if it's written in .NET.
The easiest way would be to download the 2012 SDK, Microsoft already provide a nice walkthrough on how to implement your custom editor HERE.
The process is:
Install the SDK
Fire up VS2012; Select New Project -> Other Proj Types -> Visual Studio Package
Visual C#, company name, etc...
Tick the "Custom Editor" tickbox
Fill in the rest of the details
So now you're presented with all the source of a vanilla text editor, and the part you want to hook in to is the IPersistFileFormat::Load() and IPersistFileFormat::Save() functions found under EditorPane.cs and put your encryption/decryption routines in there, thus you'll be left with a text editor with a custom encrypted file format.
This may not do what you need, since you need to call third party exe. However this answer may be useful for others that have access to source code (or a dll or library).
You could write a file system filter that encrypts/ decrypts the data to and from disk. Note that the driver sits at the OS level, and is outside of Visual Studio.
From the MSDN article File Systems and File System Filter Drivers:
A file system filter driver intercepts requests targeted at a file system or another file system filter driver. By intercepting the request before it reaches its intended target, the filter driver can extend or replace functionality provided by the original target of the request. Examples of File Systems and File System Filter Drivers include anti-virus filters, backup agents, and encryption products.
See this Code Project article for a tutorial: File System Filter Driver Tutorial. The article does not show how to do encryption/ decryption, but shows how to get a simple driver up and running.
There are extensions that will capture events to the current window save for example and what turns out to be document load. ** This is not a custom editor **
check out the following two links:
http://msdn.microsoft.com/en-us/library/dd885244.aspx
and a fairly complete open source addin that works with files when saved (regardless of type)
https://bitbucket.org/s_cadwallader/codemaid/src/7cf1bf6108801f48b85e30d85e1646fbc73ba889/CodeMaid/Integration/Events/RunningDocumentTableEventListener.cs?at=default
which hooks the RDT table to extend the current environment. You would need to adjust from here of course but this should get you going in the right direction.

Office, Save to SharePoint, Locations ... Add Delete from list

In Word under the Save to SharePoint there are Locations and Recent Locations.
How can I manually add to the list of Locations.
Well ideally I want to do this via code or script so for every user in the company they have the default set of libraries already set up. Asking them to browse through SharePoint is not only slow, but tedious.
I assume that list must be stored locally somewhere and I could potentially edit that local file to control the list?
Well, I am no guru, but by copying exporting an existing registry entry for a site, and then modifying it, and then merging it in, I can add sites. Typing in Regeditor or similar would like do as well. Here is an example where a merged in a Shared Document Library. So by creating your default entries, you could add them. If there is a better way or solution you have found, let us know!
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Server Links\Published\My Site\Shared]
"LinkType"=hex(b):02,00,00,00,00,00,00,00
"IsMember"=dword:00000001
"IsPublished"=dword:00000001
"Url"="https://mysite.company.com/Shared Documents"

Resources