Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnAction - Adding a command bar


I'm trying to add a command bar to excel.
I have the following code in Sub Auto_Open() :

tmpControl.Caption = "Workbook1"
tmpControl.OnAction = "Workbook1.xls!RunMacro"
tmpControl.Tag = "Workbook1"

I'm wanting to change the tmpControl.OnAction to open the workboo
"Workbook1". I know this is set up to run the macro "RunMacro", bu
I'm not sure how to change it so when I click on the command bar, i
will simply just open the workbook.


Any help is greatly appreciated!!

Thanks,


DejaV

--
DejaV
-----------------------------------------------------------------------
DejaVu's Profile: http://www.excelforum.com/member.php...fo&userid=2262
View this thread: http://www.excelforum.com/showthread.php?threadid=37635

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnAction - Adding a command bar


OnAction runs macros. Just create a macro that opens the workbook yo
want and point your OnAction command to that.

-H

--
headtoadi
-----------------------------------------------------------------------
headtoadie's Profile: http://www.excelforum.com/member.php...fo&userid=2402
View this thread: http://www.excelforum.com/showthread.php?threadid=37635

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnAction - Adding a command bar


I knew it was for macros, but I was wondering if there was something
that I could do to directly open the workbook.

I have already created a macro that only has a = now() in it

It solved my problem, but thought it was a cheesy way to do it. I
could not think of anything better.



Thanks,

DejaVu


--
DejaVu
------------------------------------------------------------------------
DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629
View this thread: http://www.excelforum.com/showthread...hreadid=376352

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnAction - Adding a command bar


Hi another sugestion for you!

Try this, the first 3 lines turn standard menubars off, the 4th you
need to insert your menu bar name and the next 2 lines (which you can
repeat) are to assign subs to buttons when the workbook is opened
(modify with your names). don't forget the things you turn off (False)
in an Auto_open need to be turned back on (True) in your Auto_close

Hope this helps

Simon

Sub Auto_open()

With Application
..CommandBars.ActiveMenuBar.Enabled = False
..CommandBars("Formatting").Visible = False
..CommandBars("Standard").Visible = False
..CommandBars("your menubar name").Visible = True
..CommandBars("your menubar name").Controls("your button name").OnAction
= "your sub name"
..CommandBars("your menubar name").Controls("your button name").OnAction
= "your sub name"
..DisplayFullScreen = False
..DisplayFormulaBar = False
..DisplayStatusBar = False
End With
End Sub


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=376352

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default OnAction - Adding a command bar


Got it! Thanks for your suggestions... I have the results I was looking
for!


Thanks for the assistance!


DejaVu


--
DejaVu
------------------------------------------------------------------------
DejaVu's Profile: http://www.excelforum.com/member.php...o&userid=22629
View this thread: http://www.excelforum.com/showthread...hreadid=376352



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
Adding a Dos command in EXCEL Gareth - Network analyst. Excel Discussion (Misc queries) 10 June 23rd 06 12:56 PM
adding a command button to an excel cell? betelguese Excel Discussion (Misc queries) 1 March 22nd 05 03:09 AM
Adding Code to an Existing Command Button with VBA jasoncw[_2_] Excel Programming 1 February 15th 05 11:15 PM
Adding a command button Roy Thompson Excel Programming 2 October 4th 04 10:12 PM
OnAction command failure [email protected] Excel Programming 4 November 18th 03 07:50 PM


All times are GMT +1. The time now is 06:23 AM.

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"