Downloading File with importrange function failing - think it's a bug - excel

I've been saving Google Sheets to Excel without any problems for a while. These sheets have always successfully saved and opened in Excel with the importrange function. However, recently it hasn't been successfully saving correctly.
It used to just have the static value (e.g, 40). There used to be an IFERROR in the first cell in the header row but now it exists in every single cell.
E.g, each cell would have something like this:
=IFERROR(__xludf.DUMMYFUNCTION(importrange(blahblah)),"40").
DUMMYFUNCTION throws an error and "40" is returned as a result. but "40" is a string, not an integer which messes up all my formulas.
I also know this isn't an Excel issue because OpenOffice is doing the same thing with the file.
I'm pretty sure this would be a bug because why would it be working for months and then suddenly stop working?
What should I do?

I'm thinking it's a bug too.
Workarounds
On Excel
Copy and paste as values only the ranges with IFERROR(__xludf.DUMMYFUNCTION(..., then use Excel's UI tools to convert numbers shown as text to numbers.
Selectively remove quotes on the IFERROR second argument of the cells causing problems
Remove =IFERROR(__xludf.DUMMYFUNCTION(),"value") except value (we could use Excel's built-in FIND & REPLACE for this)
On Google Sheets
Use Copy > Paste as values only on the range areas having formulas with non-compatible functions like IMPORTRANGE, QUERY, FILTER, etc.
If you only need the values, download it as CSV instead of XLSX
IMPORTANT
In order to help to prioritize this issue, send feedback to Google. To do this open a Google Sheets spreadsheet, click on Help > Report a problem, then fill the feedback form and submit it.
Related stuff
I posted 5 small articles about this in Spanish. You could find them listed on https://www.rubenrivera.mx/p/descargar-hcg-excel.html.

We accidentally created a workaround for this bug with a different sheet that was just set up like this.
This works when you IMPORTRANGE into another Google Sheet. We are doing it into a Google Sheet with a single worksheet - haven't tried it with multiple.
It's going to sound a little nuts but it works for us.
In the first cell of your import range put a hyperlink in the original document you are importing from. This is in the first cell of the import range. We linked it to a worksheet in the original document. It has worked and failed with an external link. With an external link it worked when I linked it to an internal link, then changed it. But when I deleted the cell and just straight linked it to an external URL it didn't work.
Then #timbo was right - put data validation in. This can be in part of the document that isn't being imported into the second sheet. I put it in the first line of the import range but outside what I was importing. It might have to be the first line. I just put a date in one cell, then in the next cell data > data validation > then choose that one date as the data range.
For aesthetics I have hidden the first row in one Google Sheet I am importing into. In another I made the first cell link the title of the sheet and put the data validation outside the import range. Both of these work.
Let me know if this works for you.

Until this bug is fixed, a workaround is to put a data validation (Data > Data Validation) on the imported data (Any kind of data validation will do).

Related

Using an Excel Macro to identify and then filter out specific rows

I've been attempting to create a macro to grab certain rows in my excel sheet to no avail. Here's what I am looking at before.
I need to find the wording "Car result printed - (Car Name)"(shown under A2) and grab the content RIGHT below it and than paste that content to another column. As the second photo shows, F-150 was properly pasted into another column. Instead of a single instance this would have hundreds obviously.
I tried using a variety of macros, but kept getting stonewalled (probably because my lack of VBA). Any help would be appreciated!
Thank you all.

Merging the cells in excel and giving the hyperlink using Spreadsheet::WriteExcel

I am using Spreadsheet::WriteExcel. I want to merge two cells and give the hyperlink to the content inside merged cells.
I have tried like this.
$Log_Sheet->merge_range('D2:E2','Home',$MergedFormat);
$Log_Sheet->write_url('D2','internal:sheet1!A1');
This is working fine but when I try to open a file it shows a warning saying File error: data may have been lost. This occurs because D2 cell is being overwritten.
How can I merge cells and give hyperlink in one call?
I can't promise this works on Spreadsheet::WriteExcel, but it does on Excel::Writer::XLSX. I'd encourage you to try it on Spreadsheet::WriteExcel.
With merged ranges, once you declare a format, you need to continue using it for that range and never use it for non-merged ranges. So, if you take your code and add the tag and the format object:
$Log_Sheet->merge_range("D2:E2", 'Home', $MergedFormat);
$Log_Sheet->write_url('D2', 'internal:sheet1!A1', 'Click Me!', $MergedFormat);
It does appear to work... on Excel::Writer::XLSX. Sorry to keep referencing that.
Alternatively, per the previous post (File Error:data may have been lost while giving hyperlinks), you can also use the built-in Hyperlink function within Excel:
my $merged = $workbook->add_format();
$worksheet->merge_range("A10:A11",
qq{=hyperlink("#'Sheet3'!A1","Click Here!")},
$merged);

Locating Lost Excel Macro Formula From Old Data Sheet

I'm resurrecting some old scientific data from the early 2000s.
I need to locate the custom functions that allowed the data to be shown. The spreadsheet that I have is full of #REF! cells, as they are supposed to be calculated based on a custom-defined formula (here, called 'RESECTION').
How do I find this formula? If I can see the math it was performing, I will be able to use this old data, and extend our timeseries significantly.
The spreadsheet is an ".xlsm" document. There is an associated file that is ".XLM"; it provides some GUI-like functionality that is now broken, and I do not see how to access the commands (?) or other VBA that is inside.
I have not had success with this solution.
File with the VBA can be found here; SURVEY.XLM.
Problem is seen here; calling function from SURVEY.XLM. How do I access the formula within here?
I can see that the formula is in there; how do I see the calculation it performs?
RESECTION is a named range refering to cell A4 on the hidden Survey sheet.
In the VBE immediate window type thisworkbook.Sheets(2).visible = true and then thisworkbook.Sheets(2).select.
Cell Survey!A4 contains the value =RESULT(64).
The rest of the sheet contains the macros - first time I've seen or tried to use a filled in macro sheet.
I tried Ctrl+Fto find the definition of RESULT but it comes up with Macro error at cell [SURVEY.XLM]SURVEY!A364.

Indirect not working

I want to reference an external workbook that is open. If I type =path\[file] directly into the cell (even though I am still asked to 'Update Values',) I am able to get the data I require. However, I am using INDIRECT because the name of the file changes everyday (date). So, I am using CONCATENATE to create a filename daily and then using INDIRECT to the cell where the concatenated formulas is. If you paste values to see what is being generated formula, it is exactly the same formula as above, =path\[file]. However, I continue to only get #REF! error.
I read through this, https://support.office.com/en-us/article/control-when-external-references-links-are-updated-87861952-ca9d-4d2a-a986-4d672c908d0d, and I still can not figure it out. I had it working on my computer at home last night but today and work it is giving me trouble.
To clarify, the formula that I am trying to get to work looks like this =INDIRECT("'"&CONCATENATE($F$129,$F$130,F95)) which worked yesterday at home. Can someone lead me in the right direction?
EDIT:
I have tried two options, =INDIRECT(F121) and =INDIRECT("'"&F121). The contents of F121 have been =CONCATENATE("'",F191,F192,F157) and =CONCATENATE(F191,F192,F157), respectively. I have also tried =CONCATENATE("'",F191,F192,F157) in the destination cell. F191 = [Liquidity Risk Dashboard v2.03 -, F192 = =TEXT(E3,"yyyymmdd")&"]", and F157 = Calculations'!D122. If I write ='[BMI Liquidity Risk Dashboard v2.03 - 20170105]Calculations'!D122 am asked to update values but, 100% have both workbooks upon in same instance
If I understand what you really have in your cells, the problem is that you are not properly naming the source workbook.
Try changing
F192: =TEXT(E3,"yyyymmdd")&".xlsb]"
Replace .xlsb with whatever the file extension really is for your file. (eg: .xlsx, .xlsm, .xls)

Sorting In Cell List Box Using An Excel Formula

I have a spreadsheet where I am populating a cell in a worksheet with a drop down list using Data Validation, with a Named Range as the source. The Named Range is based on a worksheet called Services, where the data starts in the second row, the first row being headings.
This works fine where the name has been defined using the following formula:-
=OFFSET(Services!$A$2,0,0,COUNTA(Services!$A:$A),1)
However, the list is not alphabetically sorted, and all the formulas I have come across on the internet have not achieved this for me.
One site offers a solution which says
If you can handle extreme formulas, here is an all-in-one formula…
However, when I attempt to paste this in to the “Refers To” box when defining the name, it won’t paste (no error message). At first I thought this was because the formula was too long (about 360 characters) but I understand Excel 2003 should handle formulas that are 1024 characters. So I am a bit stuck and would appreciate any suggestions.
I am working for an organisation which is still using Excel 2003, with no immediate prospect of an upgrade.
I think you may be hitting a version limitation (works in Excel 2013) but in any case that name may not help because Data Validation requires a delimited list, or a reference to a single row or column and I think your formula does not provide that.
However, you should be able to create the sorted version with your formula and then name the range that populates - using that Name for your List Source: in Data Validation.

Resources