Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.basic.visual.misc > #94
| From | "Ivar" <ivar.ekstromer000@ntlworld.com> |
|---|---|
| Newsgroups | comp.lang.basic.visual.misc |
| References | <aiUsp.26$2z7.14@newsfe15.ams2> <ip194v$a7k$1@dont-email.me> |
| Subject | Re: VB6 to Excel |
| Message-ID | <eZWsp.41064$5t2.32770@newsfe06.ams2> (permalink) |
| Organization | virginmedia.com |
| Date | 2011-04-24 16:04 +0100 |
Thank you for your reply .Select - That's the bit I was missing. Got it now After adding a reference to "Microsoft Visual basic for Applications Extensibility" to the VB6 project I can now add a std Module to the Excel Project files and add code to that. I would still rather put the code in the click event of the button tho. Using the Macro recorder is an easy way to get the VBA sintax, it's unfortunate that you can't use the macro recorder to record that fact that you are creating a macro. Oh well :-) Thanks again Ivar > With xlSheet > .Shapes.AddFormControl xlButtonControl, 100, 100, 100, 100 With > .Shapes(1) > 'Control must be selected to edit text > .Select: Selection.Characters.Text = "ButtonCaption" > .OnAction = "MacroName" > End With > .Cells(1).Select 'exit edit text mode > End With > > I don't know how to programmatically insert code behind the worksheet, so > hopefully someone will step up to help you with that. (I usually build an > Excel XLT that's all set up to receive data, with layout, menus/controls, > and formatting already in place) > > <FYI> > It's always a good idea to go through a process manually and run Excel's > macro recorder so it generates code. This should give you what you need to > automate from VB6. Note that the generated code will need to be cleaned up > some to get rid of the inefficient coding the macro recorder creates. > </FYI> > > -- > Garry > > Free usenet access at http://www.eternal-september.org > ClassicVB Users Regroup! comp.lang.basic.visual.misc > > >
Back to comp.lang.basic.visual.misc | Previous | Next — Previous in thread | Next in thread | Find similar
VB6 to Excel "Ivar" <ivar.ekstromer000@ntlworld.com> - 2011-04-24 13:01 +0100
Re: VB6 to Excel GS <gs@somewhere.net> - 2011-04-24 09:40 -0400
Re: VB6 to Excel "Ivar" <ivar.ekstromer000@ntlworld.com> - 2011-04-24 16:04 +0100
Re: VB6 to Excel ralph <nt_consulting64@yahoo.net> - 2011-04-24 10:54 -0500
Re: VB6 to Excel GS <gs@somewhere.net> - 2011-04-24 12:28 -0400
Re: VB6 to Excel GS <gs@somewhere.net> - 2011-04-24 14:58 -0400
Re: VB6 to Excel Steve Rindsberg <steve@rdpslides.com> - 2011-04-24 12:51 -0400
Re: VB6 to Excel GS <gs@somewhere.net> - 2011-04-24 13:44 -0400
Re: VB6 to Excel ralph <nt_consulting64@yahoo.net> - 2011-04-24 12:23 -0500
Re: VB6 to Excel ralph <nt_consulting64@yahoo.net> - 2011-04-24 12:30 -0500
Re: VB6 to Excel Steve Rindsberg <steve@rdpslides.com> - 2011-04-25 15:57 -0400
Re: VB6 to Excel GS <gs@somewhere.net> - 2011-04-25 16:38 -0400
Re: VB6 to Excel Steve Rindsberg <steve@rdpslides.com> - 2011-04-26 19:54 -0400
Re: VB6 to Excel GS <gs@somewhere.net> - 2011-04-26 23:06 -0400
csiph-web