Excel workbook ignore some cells in version control - excel

I have an excel workbook which has the Office 365 default version control. The workbook is saved on sharepoint, so that multiple people can edit it at the same time.
However, some cells in this workbook are designed to change based on where the user's clicks with the cursor. Let's call them dynamic cells.
Theses dynamic cells contains a result that should only interest the owner of the cursor, and not the other users. This is problematic when multiple user try to see the result on a same dynamic cell, because the result will be correct only for the last person which has click on the workbook.
I don't want to version control these dynamic cells.
Is there a way to do it ?
For a basic git analogy to resume the problem, I'd like to add some excel cells to the .gitignore

Related

Apache POI Excel: ActiveSheet results in multiple sheets in PrintPreview in Libreoffice

I have a Workbook with 3 different sheets (A, B, C). I create them with the POI in the same order and the whole creation process works quite fine. Somehow I want to have the last sheet as the active one. Therefore I set
workBook.setActiveSheet(2);
When I open the workbook with Libreoffice 7.1 than C is displayed as the active one. When I open print preview the first sheet (A) is always included. Changing the code to set as well C as the selected one won't help.
Is there a way to fix it for Libreoffice? (to have not A included in the print preview)
In Excel as well as LibreOffice Calc multiple sheets can be selected in a workbook. That's a wanted feature because then all settings are applied to all selected sheets. So, in GUI, you can set sheet properties - page settings for example - to multiple sheets the same time. Also changes to cells in GUI are applied to all selected sheets. So you can change cell formatting as well as cell values in multiple sheets the same time.
That's why the Workbook.setActiveSheet will set the active sheet - only one sheet can be the active one - but will not deselect sheets. To deselect sheets, Sheet.setSelected(false) needs to be used.
So if you want only the active sheet shall be selected, you need deselect all others.
Using HSSF Workbook.setActiveSheet also does not set the active sheet selected. So you should do this using Sheet.setSelected(true).
In your case:
...
workBook.getSheetAt(0).setSelected(false);
workBook.getSheetAt(1).setSelected(false);
workBook.getSheetAt(2).setSelected(true);
workBook.setActiveSheet(2);
...

Dynamic Workbook Name changes and cell references - Is it possible?

my question is a pre-code question, as I would like to verify if and which is the best option to go about this - either formula, VBA or not possible.
I have a main workbook with an array of codes inside cells in sheet 1 - all in the format HXXX-XXX-XXX where X is numbers ranging from 0-9. Each code has an associated revision number as shown in the attached picture.
The workbook itself is named in the format: 'HXXX-XXX-XXX-YY Example Title' where YY can be any number starting from 0 to infinity (in theory). Only YY is subject to updates in the title. If changes are made in this workbook, then a new version is saved, with the YY changing in the title to the next consecutive number - Nothing else changes.
From this main workbook there are a large number of other workbooks (around 50) which share the same codes and revisions. My goal is to link all these workbooks up so that I only have to update a core main workbook and the rest of the codes (HXXX-XXX-XXX) revisions in all the other linked workbooks update accordingly.
The problem is that the other linked workbooks have a dynamic name in the format: 'HXXX-XXX-XXX-YY Example Title 2' where YY can be any number starting from 0 to infinity. YY gets updated to the next consecutive number if a change is made inside the document and this document is then saved as a separate document using Save As. NOTE: not all workbooks will get updated at the same time, as it all depends on which codes and therefore revisions are changing.
My question is firstly, is this possible with current excel functions to update links with ever-changing workbook links, which are saved as different files each time in the same folder?
Secondly, I have read about the INDIRECT function, but it is limited only to having the required workbooks opened at the same time as the updates to the main workbook, hence I am unsure that Formulas will work (I will be linking 50 workbooks to the main workbook) - From this I am gauging that VBA may be the best option, but I would like to double check this is possible before I begin attempting the code.
Of course the use of Formulas in the sheets would be much better, but because the file names are dynamic, and since the updated workbooks are saved as different files each time changes are made to it, I don't believe this is possible.
If I understand your problem correctly you need to differentiate between 3 things.
Using only Excel Formulas.
The problem with this is that formulas crossing workbooks have the big disadvantage, that you need to have the source-workbook open, otherwise manny formulas will not work correctly or update. You also have the disadvantage that saving the file needs still to be done automatically. The advantage is that you do not need VBA macros.
Using Power Query
With Power Query youmight be able to solve the problems with the dynamic names.You can even read a whole folder of files, combine them and do transformations without the need to open the files manually. But you still need to save new files manually and the files will only update once they are opened.
Using VBA
You can prettymuch do everything you asked in your problem description but VBA has its own disadvantages. Firstly the file-format ".xlsm" is not allowed by the IT department everywhere. Also to work, every user using the files needs to activate macros, otherwise the macros won't get executed. Therefore I think a VBA solution is better fitted if you only have a small circle of users or if you can execute the macros on your own (e.g. if the main workbook was updated, you need to execute a macro which opens, modifies and saves all affected files). After that you colleagues do not need VBA themself.
Possible solution:
To avoid VBA you could try to create a Power Query in each "other workbook". The query will read all filenames in the folder where the main workbook is located. Now you sort and filter for the workbook with the newest/highest ID/Titel automatically and load the result as an seperate Excel sheet (all that is possible with power query and without VBA).
Now you can use the "indirect" formula to use the ID/Titel to link to the newest main workbook. As mentioned above this will require that the main workbook is opened. Otherwise the indirect formula will not update the values. If that is out of the question, you probably need to go with VBA.

How to stop Bloomberg links updating in Excel

I am trying to use an Excel workbook that has links to Bloomberg data in. The data has been pulled from Bloomberg already. I then want to ensure that when I send this workbook to someone that they can use the sheet without a Bloomberg terminal connection. The user without the Bloomberg feed has set calculations to manual in Excel however when they try and save the workbook it automatically tries to update the fields and gives #NAME errors in the fields where Bloomberg values should be.
Is there a way to stop Excel from trying to refresh the Bloomberg links when the workbook is saved? I have tried VBA Workbook_AfterSave and Workbook_BeforeSave events but that did not seem to work.
A touch embarassed to admit but in Options > Formulas > Manual there is a check box for calculating the workbook before saving. I unchecked that and it worked.
According to the license, you're not supposed to remove values obtained using the API (Excel) from the computer where the Bloomberg Terminal is installed. That being said, if cells cease being Excel formulas they will no longer attempt to update to an up-to-date value. To do this, copy the cells that currently have a BDP/BDH formula and right click -> paste special -> values. This is also useful if you don't want the values refreshing every time you open the worksheet on the same computer.

Use formulas from other workbooks?

My group currently uses Excel workbooks to track performance of employees. Each employee has their own workbook and they are identical except for the user entered data. There are custom VBA formulas on this workbook that take the data and generate a score base.
What I would like to do is move these formulas to another workbook, that way if a calculation needs to be changed, it can be changed in one source document, as opposed to hundreds of workbooks.
I'm envisioning something like...
='[Source Formula Workbook.xlsm]'!Formula_A(A1, A2, A3...)
...where A1, A2, A3 are cells in the user workbook and this returns the value of Formula_A from my hypothetical source workbook. What's the right way to accomplish this?
The usual way to do this is to move the VBA functions to an XLA/XLAM addin and store the addin on a network drive. Then each employee needs to use the Excel Addin Manager (or an installer) to add the networked XLA to their Excel.
see http://www.cpearson.com/excel/createaddin.aspx on how to create an addin.
You can create a simple installer XLSM file that uses VBA to add the XLAM to the addins list:
With AddIns.Add(FileName:=MyNetworkAddInPath)
.Installed = True
End With

How to crack an Excel workbook that looks up values?

Alright I know this isn't 100% related to programming (the Excel book in question doesn't use VBA at all) but I'm hoping someone can help me out with this or point me in the right direction.
My boss got a spreadsheet from a vendor that has a combobox/dropdown list with various part numbers; when you select one it populates the rest of the form with a lookup containing additional items. I've been tasked with "cracking" this and finding the list that they're using to populate so we can make use of it.
The thing is... there's no VBA code, no macros, no data connections, and only one Worksheet displayed in Excel while the lookup code references a Sheet1. I've tried to display hidden worksheets and it says there are none... so where on earth could this list be kept? My boss is getting impatient and is asking me if I've broken it yet. It's not a big deal if it can't be done, I just have no clue where to continue looking for it and I don't know what to tell my boss when he asks me if I'm done.
Can anyone help?
It's possible to hide a worksheet using VBA so that it can't be unhidden from the UI.
Try the method for un-hiding all hidden workhseets outlined here:
http://www.automateexcel.com/2004/12/14/excel_vba_unhide_all_worksheets/
My guess is that it is a Data Validation list which references a constant list of values or a range on a "Very Hidden" sheet. In Excel 2007, select one of the cells with the drop-down, click on the "Data" tab in the Ribbon, click on "Data Validation" in the Ribbon and see what you have. In Excel 2003 it is the Data -> Validation... command.
Another possibility if you know the name of the worksheet is "Sheet1" is to add a new worksheet, enter "=Sheet1!A1" into cell A1 of the new worksheet, and copy this cell down and to the right for as large of an area as you need to see the data you are interested in.
If you can post a URL to download the workbook (assuming it is not a trade secret) you would be more likely to get an accurate answer.
Could it be some data stored on the same sheet.
Possibly in columns which are either hidden, or which are far off the actual page?
Isn't this just data from the worksheet only?
Column header dropdown lists acts as filters, they show distinct values of a column.
This is a feature of Excel.
The items could be cached from a currently unavailable resource. Try saving it out to xml and searching for a known string.
Click on the cell that display a drop down list when selected
From the menubar select data>validation
In the dialog box copy the content of the source text box
Now paste the content on any empty cell on your worksheet
Select a drag it down to see the values populating the list
Chris
------
Convert your Excel spreadsheet into an online calculator.
http://www.spreadsheetconverter.com
I am assuming that you have broken this by now, but just in case you havent. This is certainly a case of data validation using a named range which is house on another sheet that was designated "very Hidden" from the vba console. You will need to open up the VBA project of this worksheet and designated the "very Hidden" sheet to just Hidden and then you will be able to unhide it, or the other setting at which point it will be viewable.

Resources