Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Macro/Command Button

Excel 2000 (or 97)
Although it's been a while, I have done this, but I cannot get it work now.
I created a macro by using the macro recorder. I gave it the name Release. I
then created a command button on the worksheet. The name of button is
btnRelease. In design view, I selected the button and clicked ViewCode. That
gave me the click event:
Private Sub btnRelease_Click(). Between that and End Sub, I wrote "Release"
(no quotation marks). I thought that would reference the macro and run it. I
get the message "Function or interface marked as restriced, or function uses
Automation type not supported in Visual Basic.
Am I missing a step?
I'll appreciate the help,

--
Howard
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Macro/Command Button

I just used the macro recorder to sort a work sheet on the date field. I gave
the macro a softcut key: Cntr-Shift-R. The macro works fine if I use the
short cut key. I thought I could just reference the macro by name (Release)
in the Click event of the command button to get it to run. Doesn't work.(?)

"Don Guillett" wrote:

As always, copy/paste your code for comments.

--
Don Guillett
SalesAid Software

"Howard" wrote in message
...
Excel 2000 (or 97)
Although it's been a while, I have done this, but I cannot get it work

now.
I created a macro by using the macro recorder. I gave it the name Release.

I
then created a command button on the worksheet. The name of button is
btnRelease. In design view, I selected the button and clicked ViewCode.

That
gave me the click event:
Private Sub btnRelease_Click(). Between that and End Sub, I wrote

"Release"
(no quotation marks). I thought that would reference the macro and run it.

I
get the message "Function or interface marked as restriced, or function

uses
Automation type not supported in Visual Basic.
Am I missing a step?
I'll appreciate the help,

--
Howard




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Macro/Command Button

If it breaks in xl97, try adding:

activecell.activate

at the top of the code.

Or you can change the .Takefocusonclick to false for that commandbutton.



Howard wrote:

Excel 2000 (or 97)
Although it's been a while, I have done this, but I cannot get it work now.
I created a macro by using the macro recorder. I gave it the name Release. I
then created a command button on the worksheet. The name of button is
btnRelease. In design view, I selected the button and clicked ViewCode. That
gave me the click event:
Private Sub btnRelease_Click(). Between that and End Sub, I wrote "Release"
(no quotation marks). I thought that would reference the macro and run it. I
get the message "Function or interface marked as restriced, or function uses
Automation type not supported in Visual Basic.
Am I missing a step?
I'll appreciate the help,

--
Howard


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
JK JK is offline
external usenet poster
 
Posts: 78
Default Macro/Command Button

Howard,

You need to call the macro. Try this: Call Release

Jim Kobzeff

"Howard" wrote in message
...
Excel 2000 (or 97)
Although it's been a while, I have done this, but I cannot get it work

now.
I created a macro by using the macro recorder. I gave it the name Release.

I
then created a command button on the worksheet. The name of button is
btnRelease. In design view, I selected the button and clicked ViewCode.

That
gave me the click event:
Private Sub btnRelease_Click(). Between that and End Sub, I wrote

"Release"
(no quotation marks). I thought that would reference the macro and run it.

I
get the message "Function or interface marked as restriced, or function

uses
Automation type not supported in Visual Basic.
Am I missing a step?
I'll appreciate the help,

--
Howard





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Macro/Command Button

The Takefocusonclick property is set to false. Activecell.activate didn't
correct it. But, thanks for the response.

"Dave Peterson" wrote:

If it breaks in xl97, try adding:

activecell.activate

at the top of the code.

Or you can change the .Takefocusonclick to false for that commandbutton.



Howard wrote:

Excel 2000 (or 97)
Although it's been a while, I have done this, but I cannot get it work now.
I created a macro by using the macro recorder. I gave it the name Release. I
then created a command button on the worksheet. The name of button is
btnRelease. In design view, I selected the button and clicked ViewCode. That
gave me the click event:
Private Sub btnRelease_Click(). Between that and End Sub, I wrote "Release"
(no quotation marks). I thought that would reference the macro and run it. I
get the message "Function or interface marked as restriced, or function uses
Automation type not supported in Visual Basic.
Am I missing a step?
I'll appreciate the help,

--
Howard


--

Dave Peterson


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Macro/Command Button

Tried it. Still isn't working.
I have to go out for a while. I'll try to check back later. Thanks for all
your responses!
Howard
"JK" wrote:

Howard,

You need to call the macro. Try this: Call Release

Jim Kobzeff

"Howard" wrote in message
...
Excel 2000 (or 97)
Although it's been a while, I have done this, but I cannot get it work

now.
I created a macro by using the macro recorder. I gave it the name Release.

I
then created a command button on the worksheet. The name of button is
btnRelease. In design view, I selected the button and clicked ViewCode.

That
gave me the click event:
Private Sub btnRelease_Click(). Between that and End Sub, I wrote

"Release"
(no quotation marks). I thought that would reference the macro and run it.

I
get the message "Function or interface marked as restriced, or function

uses
Automation type not supported in Visual Basic.
Am I missing a step?
I'll appreciate the help,

--
Howard




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Macro/Command Button

Not that I know. (While in the VBE, I hit F2 to bring up the object browser and
only found one Release and that was ReleaseFocus.)

Glad you got it working, but I don't think I'd live with Sort as the name. That
is a method name (like range("a1:b99").sort...



Howard wrote:

Is "Release" a restriced name in Excel? I changed the macro name to Sort and
again in the Click Event from Release to Sort, and it is working now. That's
all I think I did. I've been playing with it too long.
HF

"Dave Peterson" wrote:

If it breaks in xl97, try adding:

activecell.activate

at the top of the code.

Or you can change the .Takefocusonclick to false for that commandbutton.



Howard wrote:

Excel 2000 (or 97)
Although it's been a while, I have done this, but I cannot get it work now.
I created a macro by using the macro recorder. I gave it the name Release. I
then created a command button on the worksheet. The name of button is
btnRelease. In design view, I selected the button and clicked ViewCode. That
gave me the click event:
Private Sub btnRelease_Click(). Between that and End Sub, I wrote "Release"
(no quotation marks). I thought that would reference the macro and run it. I
get the message "Function or interface marked as restriced, or function uses
Automation type not supported in Visual Basic.
Am I missing a step?
I'll appreciate the help,

--
Howard


--

Dave Peterson



--

Dave Peterson

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
Use Macro To Change Which Macro Assigned To Command Button CVinje Excel Discussion (Misc queries) 0 May 25th 10 09:55 PM
Run a macro using a command button Tdahlman Excel Discussion (Misc queries) 9 March 5th 08 07:59 PM
Run Macro from Command Button [email protected] Excel Discussion (Misc queries) 1 April 23rd 07 04:36 PM
Command Button & Macro alexm999[_10_] Excel Programming 2 January 28th 04 09:12 PM
Macro for command button wcmar10 Excel Programming 0 July 30th 03 09:26 PM


All times are GMT +1. The time now is 01:08 AM.

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

About Us

"It's about Microsoft Excel"