BDP formula not working with write_formula
See original GitHub issueHi,
I am using XlsxWriter to do write a BDP formula to a cell in Excel but it appears to do causes errors and outputs 0.0, as well as presenting a series of errors when opening the outputted excel file.
import xlsxwriter
orders_file = r'Q:\.....'
date_extension = str(date) + '.xlsx'
writer = pd.ExcelWriter(orders_file+date_extension, engine = 'xlsxwriter')
df.to_excel(writer, sheet_name='Loans', index=False,startrow=1,startcol = 3, header=True)
loans_sheet = writer.sheets['Loans']
worksheet.write_formula('B3', "=BDP(LEFT(C3,LEN(C3)-1)&' Corp', 'Issuer')")
workbook.close()
I’ve deleted all other information, and the Loans tab has the necessary info written to it before I try to put the formula there. Deleting the other info and saving it again seems to get rid of these errors but the value is still 0.0 This is the log file of errors that comes up :
<?xml version="1.0" encoding="UTF-8" standalone="true"?>-<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>error079040_01.xml</logFileName>
-<removedRecords>
<removedRecord>Removed Records: Formula from /xl
/worksheets/sheet4.xml part</removedRecord>
</removedRecords> </recoveryLog>Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Code to write formula with a cell reference - Mr. Excel
I am assuming you have tried using cell referernce instead of the date typed out and it didn't work. Code: =BDH("CL1 Comdty","PX_LAST",A1,A2,"Dir=V ...
Read more >Formulas for collecting Bloomberg Data in Excel
BDP (Bloomberg data point): returns data to a single cell within Excel. It contains only one ticker and one field. Formula Syntax: =BDP...
Read more >Q. Help! I got an error trying to download data ... - Ask a Librarian
#N/A Requesting Data - The #N/A Requesting Data message is the initial value that is placed in a cell when the formula (BDP,...
Read more >vba to write formula with dynamic cell reference - Stack Overflow
You can make Cname variable dynamic if you like: CName = Range("F3").Address ActiveCell.Formula = "=BDP(" & CName & Chr(34) & " cusip" ...
Read more >Troubleshooting Bloomberg Excel Integration
These instructions are for addressing issues using the Bloomberg ... If you open Excel and do not see a 'Bloomberg' tab or notice...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Apologies. I mistook the first and second files.
You can try the following. It loads but doesn’t calculate anything for me, since I don’t have the Bloomberg plugin. Note the
_xll.
prefix and that it should probably be an array formula. Also, the formula should have double quotes not single quotes:Good stuff. Thanks for sending the file. I’ll up date the StackOverflow question.