Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Generating Code in Excel / Macro Recorder Manipulation

First time poster, but longtime reader... Stumped with a level of
functionality that I'd like to put into a custom application. I've
built a program that allows users to setup templates for converting
existing spreadsheets (things like moving data, adding cells/formulas,
changing formatting, etc.). Each conversion step can be manually setup
through the program's UI or through forms directly inside Excel. The
one feature that I'd like to have is the ability for a user to record
their set of custom steps (as a macro) and let my program grab the code
from the created macro and store it with the template in a database.
It can then be reloaded and run when a spreadsheet is converted using
said template.

I've got the functionality to get the code through VBIDE, but stumped
on getting the process started.

So, I've hunted and hunted and there's the RecordMacro function which
is misleading since it really doesn't do anything unless the recorder
is actually running... I can't find anyway to programmatically start
the recorder... it's not an object that I can see... I don't want to
have the user start the recorder because (ideally) I'd like to be able
to default the name of the macro to what I want.

I'd like there to be a way to do what I want and maybe I'm just going
about it wrong...

Appreciate any help anyone can offer - even if it's some sort of
third-party tool.

This program was written in VB6 and this would need to apply to Excel
2000 and XP at the least with application to Excel 2003 beling a plus!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Generating Code in Excel / Macro Recorder Manipulation

I couldn't get this to work for me--but maybe it'll work ok for you:

Option Explicit
Sub testme02()

Dim ctrl As CommandBarControl
Set ctrl = Application.CommandBars.FindControl(ID:=184)

SendKeys "qwer{Enter}"
ctrl.Execute

End Sub

qwer was the name I wanted to use for the macro.

=======
Are you sure you really want to do this? It sounds very, very dangerous to me.
Heck, when I record macros, I have lots of missteps and ranges that are specific
to the data that I was using when I recorded the macro.

And how you gonna tell them to stop recording???



wrote:

First time poster, but longtime reader... Stumped with a level of
functionality that I'd like to put into a custom application. I've
built a program that allows users to setup templates for converting
existing spreadsheets (things like moving data, adding cells/formulas,
changing formatting, etc.). Each conversion step can be manually setup
through the program's UI or through forms directly inside Excel. The
one feature that I'd like to have is the ability for a user to record
their set of custom steps (as a macro) and let my program grab the code
from the created macro and store it with the template in a database.
It can then be reloaded and run when a spreadsheet is converted using
said template.

I've got the functionality to get the code through VBIDE, but stumped
on getting the process started.

So, I've hunted and hunted and there's the RecordMacro function which
is misleading since it really doesn't do anything unless the recorder
is actually running... I can't find anyway to programmatically start
the recorder... it's not an object that I can see... I don't want to
have the user start the recorder because (ideally) I'd like to be able
to default the name of the macro to what I want.

I'd like there to be a way to do what I want and maybe I'm just going
about it wrong...

Appreciate any help anyone can offer - even if it's some sort of
third-party tool.

This program was written in VB6 and this would need to apply to Excel
2000 and XP at the least with application to Excel 2003 beling a plus!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Generating Code in Excel / Macro Recorder Manipulation

Yep, thought about the danger, but it's a "feature" that I'd like to
include. I'm only including it for changes that a user might want to
make that I cannot accomodate through the software... the software's
really broad, but the macro recorder would be encouraged for use only
in situations where the series of changes are specific enough to
warrant an actual copy of the steps followed.

And, of course, not all users will have the ability to modify a
template by adding recorded code...

Thanks for the code snipet... I remember doing something with that ID
number, but I didn't think I was successful... I'll try yours.

Thanks again!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Code for Access file manipulation from Excel Tom Urtis Excel Programming 0 July 21st 05 08:31 AM
Excel 4 Macro Recorder Eloy[_2_] Excel Programming 0 July 15th 05 08:42 PM
Macro Recorder jhahes[_13_] Excel Programming 3 July 6th 05 09:58 PM


All times are GMT +1. The time now is 09:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"