none
Excel Chart Macro Issues RRS feed

  • Question

  • Hello,

    I am working on inserting macros into an excel bar chart which will allow me to click on each bar to open up separate excel files to better explain where the information is coming from. I was able to successfully do this with one bar using the following code:

    Sub MacroName()

    Dim wb As Workbook

    Set wb = Workbooks.Open("\\Drive\Folder\FileName")

    However, as soon as I try adding the next link to another bar they stop working. After messing around for a while with names of macros and even trying different modules I was able to get them to run correctly in Visual Basic, but when I go back to the chart the button I had created no longer worked like it did when I only had one button. I also tried using text boxes instead of buttons and had the same result.

    Please help, is there something I am missing or a different code or something? I am a complete noob with coding in excel.

    Thursday, May 28, 2015 4:23 PM

All replies

  • Hi,

    >> However, as soon as I try adding the next link to another bar they stop working

    What do you mean about adding the next link to another bar?

    >>when I go back to the chart the button I had created no longer worked like it did when I only had one button

    What’s the button used for? When run the button before, what it was like, and when you ran it again, what’s like. Could you please share more detailed information about your issues? If it is possible, could you please share a sample that could reproduce this issue?

    Best Regards,

    Lan

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, June 1, 2015 9:05 AM
    Moderator
  • Hello,

    I will share a little more info on the issue. I work in the office at a manufacturing company and I have a bar chart which is updated daily to show the performance of 8 different crews based on production, gross profit, revenue, and overhead expenses. We track each individual crew with excel spreadsheet reports daily. What I would like to do is to be able to present this chart which consists of 8 bars and click each one of the bars and when I click have the corresponding excel report open in a separate window so that I can share where the numbers are coming from and how well production is going. 

    As for my above notes, I was successful at making this happen with one of the bars on my bar chart and with the above coding I was able to get the macro working so that when I click the bar, the corresponding excel file opens up. However, when I attempt to make the other seven bars do the same thing by adding similar coding to the other bars on the chart it seems there is conflict between the macros because everything stops working and I can no longer get any response when I click the bar that was working.

    The real problem is that even though the above coding works as a clickable link to another file, it does not work when I try to apply it to multiple bars in the chart to link multiple files.

    I hope this explains better, and I'm not sure how to share a sample. Please let me know if you have any kind of solutions or ideas.

    Thank you,

    Jay

    Monday, June 1, 2015 3:18 PM