Identify Excel Workbooks which connect to a given Excel file - excel

My team has a large number of workbooks which connect via Power Query to a few static Excel files which are updated periodically with new data. I am trying to change these sources to a database to eliminate the need for these flat files, but my challenge is in ensuring all workbooks which connect to the static files are updated.
I am wondering if there is a way to do some sort of reverse lookup of query connections to a particular workbook so I can see which workbooks reference a given data file. I have googled a variety of questions but haven't had any luck finding an answer yet. Any help is appreciated!

Related

Team working on one master workbook through database sheet on shared drive

!We have recently spent a few days developing an Excel Master workbook for our team of 4 members to streamline our administrative tasks and to improve our record keeping practices. We now have the Excel workbook working fine on a single user basis. It has VBA macros for creating new files and folders which is already working well. However, we are 4 members on the team and it is essential that we can work on this sheet simultaneously. If we opt for the Sharepoint option, we cannot use the macros. If we use the shared Excel file option, we lose the functionality of the Master workbook as we cannot make use of tables or array formulas. Any ideas on how to work around this? We have done some research and found that one idea might be to create a database where each of the team members have access to the database via a shared drive like OneDrive. But- is this the best solution? I have never coded anything like this before and it will take me a long time to learn how to do it and before spending weeks and weeks on getting it to work, I would just like to get some advice on the recommended path forward.
Here's what the current sheet does:
Saves a list of contacts.
2.Saves a list of current tasks.
Saves a list of current deals we have in the company, customer and supplier info.
The Macro then creates a relevant file per deal on our drive and embeds a subset of new Excel worksheets we use for documentation purposes.
Any help would be appreciated!

Save logfile within Excel file using VBA

I am trying to develop a manner in VBA to track changes in a document without having to hide the contents in an extra sheet within a workbook.
I understand that if you change the extension of an Excel file to ".zip", you can access the Excel document as components sorted into directories. Is there a way to save and write to a text file within one of these directories so that I can access it every time the document is opened, without having to have the user drag a log file along with the Excel document?
Some facts:
When Excel opens the file, the file is blocked by Excel. There is no possibility to write to that file within VBA
You can store additional data into that file externally or after the Excel workbook has been closed
You would need to have code externally from the workbook to accomplish writing to that file after it has been closed. You may want to use VSTO or an oldschool Excel Addin.
you have to ensure that Excel will not destroy your changes when restructuring or repairing the file.
In the first run, your idea sounds very natural, to not use sheets from a programmer's point of view. You only have full control on Excel files when
you use external libraries (e.g. Spreadsheet Gear) or
you remote control Excel via automation.
you use openxml SDK for Excel
you use VBA
You could insert additonal information and take care that this information is not skipped by Excel.
When you want to do the tracking this way, I would suggest you to use an Excel Addin. There is actually no need for installation when using this kind of Addin. Attach to open workbook and close workbook events and ensure that all changes are written to the Excel Workbook after it has been closed. Certainly you would have to attach to all kind of other events to track all changes to the workbook. You may need to have in mind that there can be more than one workbook opened at a time.
Actually there are alternatives.
write your logging code in VBA or whatever fits
abstract away how your persist the code (e.g. use a data provider)
think about these two alternatives to store logging data:
You can save logging data in cells of excel. When using a "newer" version of excel, you have a limit of 1 million rows. You may want to implement a rolling mechanism that ensures that you never go over the border of 1 million records. (you may be dont want to track a million changes)
You can use the document properties to store you information as xml.
Last but not least, the most obvious: Why not using Excel's functionality of tracking changes? Understand track changes in Excel 2013

Treat .mdb as .xlsx?

I recently made an Excel workbook (with the help of Stackoverflow) where I have a regular input of data (each entry is one row with different columns). I then have a macro that extracts the data from a specified row to a different sheet and saves this sheet as a .PDF.
That way, I can extract specific data from this Excel "database" to a readable pdf. I do this because I need a paper version from specific entries.
For a different project I need to implement the same principle. The only difference is that I need to work with an .mdb file where the data is stored, instead of an Excel workbook.
Is there a way I can reuse my code from Excel or is it now a completely different story?
Thank you for the advice.
You can link your excel workbook to your Access tables. On the "DATA" ribbon there is a section for "External Data".
Once you've got the Access data displayed on one of your worksheets, you should be able to adapt your existing code accordingly.
From Microsoft:
Connect an Access database to your workbook

Sharepoint Excel Rest api is not working with workbook which includes % in name

Here I am trying to use Excel Rest Service to get some data from SharePoint.
Excel file Name: UserData.xlsx
This excel have two workbook
Work Data
User Salary%
I am able to get work data by using below query
.../sites/portal/_vti_bin/excelrest.aspx/Reports/UserData.xlsx/model/Ranges('''Work Data''!A24|M24')?$format=atom
So it means my URL creation logic is correct and hence I am able to get data in my C# program.
However I am not able to get data for second Workbook with below URL
.../sites/portal/_vti_bin/excelrest.aspx/Reports/UserData.xlsx/model/Ranges(**'''User Salary%**''!A24|M24')?$format=atom
I couldn't figure out why I am able to access the first workbook, but not my second; although, the URL looks same.
One reason may be that second workbook contains % (User Salary%), which might cause a problem, but I cannot rename workbook since it is created by different department.
Any help will be appreciated.
Thanks in advance.
I was facing the same issue while reading the values from Excel Sheet "Risk Matrix". It is Space " " which is creating issue in Excel REST.
XYZ.xlsx/model/Ranges('Risk matrix!K15:L15')?$format=json
The thing worked for me is to rename the Excel Sheet name:
XYZ.xlsx/model/Ranges('Riskmatrix!K15:L15')?$format=json
I tried to search other approach but due to time constraint I had to do the above work around.

VBA to write data into Excel used by multiple users on a network?

Basically I have a master workbook on a network drive which is used by many to update the sheet, I want to automate this, through my research I found there are many complications with it if I automate it.
Searching on Google gave me the following suggestions and I have noted some complications with these solutions
using VBA open and write data and close it.
there are chances that Excel is already opened by others and it is in read only mode, so I can't write. Even though I tried open and write but it's taking too long getting stuck.
Share the workbook and write data
for this to happen the workbook should be opened and shared by one at least, while writing data if two people are writing data at a time there is a chance that one could overwrite data of others
using ADO write data into Excel
I don't have any idea about ADO and how it can be used to write data into Excel, saw some examples and ended up nothing to comprehend.
Set up an Access database
Connect to the database from an Excel: Go to the ribbon: Data > From Access. This almost works like a pivot table and is indeed view only.
You can also store all the data still in an Excel and again use the External Data options (From Other Sources > Wizard > Other/Advanced > (tab) Connection > Use data source name > Excel Files > OK) to connect to it from a central Excel that all users use.
For writing to your database I would recommend using VBA nonetheless, if thats beyond you then you might want to get busy with it soon as that would probably be the best way for you to enable your users to write.

Resources