Ivar
2011-04-24 12:01:47 UTC
Hi All.
I'm using VB6 to open a .xls file and put various values, formulas and
formats in to the spreadsheet,
All works well using reference to Excel 10 Object library.
I can put a button on the sheet using something like this:
xlsheet.Shapes.AddFormControl xlButtonControl, 100, 100, 100, 100
However, 2 things I can't find any sample or help on is
How to set the Caption Property of the CommandButton and
How to put any VBA code in the click event of the button, even if it's just
MsgBox "Hello World"
Or
xlsheet.Shapes(1).OnAction = "Macro1"
Cant find any info on how to add a Macro to the excel work book
Any Pointers please
Ivar
I'm using VB6 to open a .xls file and put various values, formulas and
formats in to the spreadsheet,
All works well using reference to Excel 10 Object library.
I can put a button on the sheet using something like this:
xlsheet.Shapes.AddFormControl xlButtonControl, 100, 100, 100, 100
However, 2 things I can't find any sample or help on is
How to set the Caption Property of the CommandButton and
How to put any VBA code in the click event of the button, even if it's just
MsgBox "Hello World"
Or
xlsheet.Shapes(1).OnAction = "Macro1"
Cant find any info on how to add a Macro to the excel work book
Any Pointers please
Ivar