I'm working on a large workbook. Alot of the worksheets have a button with a macro behind them that makes a XML file using some of the data on the sheet.
I'm making a button with a macro that clicks all the other buttons. The buttons on the other pages are just normal buttons(form controls), and they all have the same name "To XML".
So far I've written this code but I can't get it to work. It does go though all worksheets and get the shapes, but I fail to select the button and click it. Does anybody have an idea how to make this work?
//This code is not exactly what i wrote, but it had the same structure. I am at home right now and can't access my work computer..
Sub clickAllXmlButtons()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Dim sh As Shape
For Each sh in ws.Shapes
If sh.Text = "To XML" Then
sh.Select
sendKeys(" ")
End If
Next sh
Next ws
End Sub

New Topic/Question
Reply



MultiQuote




|