Excel Automation - Command Buttons (control macros)

T

tcb

I would like to create an Excel workbook with command buttons (AKA
control macros). I have code to create a workbook. Now I need to
know how to create Excel command buttons, then set properties and
assign macros to the command buttons in VBA from Access. The code on
the button would generally be simple like this:

Private Sub CommandButton1_Click()

Sheets("Tab One").Select

End Sub
 
A

Alok

However, I want to create theExcelworkbook fromAccess.

Hi

You could try code such as the following.

Sheet1.Shapes.AddOLEObject classType:="Forms.CommandButton.1"

Alok
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top