Bloomberg VBA证券价格导入宏突发失效求助
Hey there, sorry to hear your Bloomberg import macro suddenly stopped working after months of smooth running! Let’s walk through some troubleshooting steps to get it back up and running.
Troubleshooting Your Broken Bloomberg Import Macro
First, Rule Out Simple Terminal/Add-in Glitches
These are the easiest fixes to check first:
- Restart your entire stack: Close Excel, shut down the Bloomberg Terminal app, and restart your computer. Temporary cache or connection blips often cause sudden failures like this.
- Verify the Bloomberg Excel Add-in is active:
- Open Excel, go to
File > Options > Add-ins - Look for the Bloomberg Excel Add-in under Active Application Add-ins. If it’s in the Inactive list, click
Go...at the bottom, check the box for the Bloomberg add-in, and hit OK.
- Open Excel, go to
- Test a manual Bloomberg function: Open a blank Excel sheet and type a basic Bloomberg formula like
=BDP("AAPL US Equity", "PX_LAST"). If this returns#N/Aor an error, the problem is with your Bloomberg Terminal connection, not the macro itself—reach out to Bloomberg support if that’s the case.
Dig into the Suspected Bloomberg Command Issue
Since you think the price extraction command is the culprit, let’s dive deeper:
- Check for Bloomberg API changes: Bloomberg occasionally updates their function syntax or field names. Type
API <GO>in your Bloomberg Terminal to pull up the latest documentation, then compare the commands in your macro (likeBDP,BDH, or any custom Bloomberg calls) to the current specs. For example, a niche price field might have been renamed, though this is rare for common fields like last price. - Validate ticker inputs: If your macro pulls tickers from a sheet, double-check that none of the tickers have changed (e.g., a company rebranded or switched exchanges). A single invalid ticker can crash the whole macro.
Use Your Error Message & Code Snippets to Narrow It Down
You mentioned the macro aborts with an error and shared a snippet of the code—let’s leverage that:
- Share the exact error details: Was it a runtime error (like
Run-time error '1004')? Or a Bloomberg-specific cell error (like#NAME?or#REF!)? The exact error text will tell us if it’s a syntax issue, a permission problem, or a data retrieval failure. - Post the full failing code block: The snippet you shared starts with
Dim path As...—if you can paste the rest of the code where the Bloomberg command is called (e.g., where it usesBDPorBDH), we can spot syntax mistakes or variable issues. For example, if a variable holding the ticker isn’t being populated correctly, that would break the command.
Quick Fix to Try If All Else Fails
If the add-in seems corrupted, you can reinstall it directly from the Bloomberg Terminal:
- Type
EXCEL <GO>in the terminal - Follow the prompts to repair or reinstall the Excel add-in—this will refresh the connection between Excel and Bloomberg.
内容的提问来源于stack exchange,提问作者Jeremie St-Jean
相关产品推荐
相关产品推荐

