Forum Discussion

Birian's avatar
Birian
Copper Contributor
Oct 26, 2023

Stockhistory function

Using Stockhistory function but shows #blocked. 

  • LeonPavesic's avatar
    LeonPavesic
    Silver Contributor

    Hi Birian,

    There are a few reasons why you might be getting the #BLOCKED error when using the StockHistory function in Excel on Mac.

    1. You are using the free online version of Excel. The StockHistory function is not available in the free online version. You need to have a Microsoft 365 subscription to use it.

    2. Your subscription to Microsoft 365 has expired. Make sure that your subscription is up to date. You can check your subscription status by going to Account > Manage Account.

    3. Your workbook is protected. If your workbook is protected, you will not be able to use the StockHistory function. To unprotect your workbook, go to Review > Protect Workbook and select Unprotect Workbook.

    4. There is a problem with the StockHistory function itself. If you have checked all of the above and you are still getting the #BLOCKED error, you can try reporting the issue to Microsoft.

    Here are some additional troubleshooting tips:

    • Make sure that you are using the correct syntax for the StockHistory function. The syntax is as follows:

     

    StockHistory(ticker, start_date, end_date, interval)​

     

    Where:

    • ticker is the stock ticker symbol.

    • start_date is the start date of the historical data range.

    • end_date is the end date of the historical data range.

    • interval is the interval at which the data is returned. The valid values are:

      • D for daily data.
      • W for weekly data.
      • M for monthly data.
    • Try using a different stock ticker symbol.

    • Try using a shorter historical data range.

    • Try using a different interval.

    • Restart Excel.

    • Restart your Mac.

    STOCKHISTORY function - Microsoft Support

    How to correct a #BLOCKED! error - Microsoft Support

    Please click Mark as Best Response & Like if my post helped you to solve your issue.
    This will help others to find the correct solution easily. It also closes the item.


    If the post was useful in other ways, please consider giving it Like.


    Kindest regards,


    Leon Pavesic
    (LinkedIn)

    • Birian's avatar
      Birian
      Copper Contributor
      Hi

      I tried logged out, reboot and log in again, still not working. I'm Microsoft 365 subscriber and not using online free version, also it's not because the protected worksheet or etc,. Now I can't even see the stockhistory function prompted when typing.
      • LeonPavesic's avatar
        LeonPavesic
        Silver Contributor

        Hi Birian,

        thanks for your update.

        here are some additional troubleshooting steps you can try:

        1. Update Excel: Ensure you are using the latest version of Excel. Outdated versions may not support the latest functions. Check for updates and install any available updates for Excel.

        2. Verify Add-ins: Sometimes, third-party add-ins can cause conflicts with Excel functions. Disable any third-party Excel add-ins temporarily and see if STOCKHISTORY starts working.

        3. MacOS Permissions: Check if Excel has the necessary permissions to access the internet. Sometimes, MacOS may block certain applications from accessing the web. Go to your Mac's System Preferences, select Security & Privacy, and ensure Excel has the necessary permissions.

        4. Check Your Region and Language Settings: The STOCKHISTORY function might have regional restrictions. Make sure your system settings, such as your region and language, are correctly configured.

        5. Test on a Different Device: If possible, try using STOCKHISTORY on a different Mac or device to see if the issue persists. This will help determine if the problem is specific to your installation.

        6. Try on a New Workbook: Create a new, blank workbook and try using the STOCKHISTORY function there. Sometimes, issues are specific to a particular workbook.



        Please click Mark as Best Response & Like if my post helped you to solve your issue.
        This will help others to find the correct solution easily. It also closes the item.


        If the post was useful in other ways, please consider giving it Like.


        Kindest regards,


        Leon Pavesic
        (LinkedIn)

Resources