Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > onAction behaviour


Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2006, 03:02 AM
jvit1964 jvit1964 is offline
Freshman
 
Join Date: Mar 2004
Posts: 30
Default onAction behaviour


hi to everybody

in a worbook i have a workbook_open macro that creates a custom command bar with a few menuitems that refer to specific macros saved inside the workbook
and i have a workbook_close macro that deletes the custom command bar as well
ive assigned each macro to each specific command using the .onaction event
it happens that if i save this workbook with a different name, all menuitems still refer to the original file, tryin to open it.

ive tried with the application.thisworkbook and the application.activeworkbook parameters tryin to give the .onaction parameter the name of the file from which run all macros

is there a any solution, but store all macros in a separate file on the server?

thanx for any kind suggestion
vit

Last edited by jvit1964; 03-27-2006 at 03:06 AM. Reason: add new lines
Reply With Quote
  #2  
Old 03-27-2006, 07:25 AM
jvit1964 jvit1964 is offline
Freshman
 
Join Date: Mar 2004
Posts: 30
Default

ive fixed the problem adding a workbook_activate subroutine in which i delete the custom bar and build a new one exatctly the previous one. in this way the menu seems to work referrin to active workbook

vit
Reply With Quote
  #3  
Old 03-27-2006, 12:53 PM
italkid's Avatar
italkid italkid is offline
Down...

Retired Moderator
* Expert *
 
Join Date: Dec 2002
Location: Belgium.
Posts: 6,731
Default

Quote:
Originally Posted by jvit1964
is there a any solution, but store all macros in a separate file on the server?
If you would work with an add-in, yes...
Reply With Quote
  #4  
Old 03-28-2006, 12:18 AM
jvit1964 jvit1964 is offline
Freshman
 
Join Date: Mar 2004
Posts: 30
Default

well im not keen with add-ins
i never created one
where shud it reside in a a 1 file server with many desktop computers configuration?

thanx
vit
Reply With Quote
  #5  
Old 03-28-2006, 02:45 AM
italkid's Avatar
italkid italkid is offline
Down...

Retired Moderator
* Expert *
 
Join Date: Dec 2002
Location: Belgium.
Posts: 6,731
Default

If the commandbar is really workbook specific, then creating the toolbar at runtime might still be the best solution, though when you'd need the same commandbar over and over, store the code necessary to create / delete the commandbar in an add-in, would be a more solid solution. This approach would allow you to store all of the necessary code in one single file (much easier to edit), but will need you to install the add-in on each single computer...
Reply With Quote
  #6  
Old 03-28-2006, 04:50 AM
jvit1964 jvit1964 is offline
Freshman
 
Join Date: Mar 2004
Posts: 30
Default

thats what i needed to know cause thi workbook shud be portable also when u r in other office or companies
i think the more effective solution is to keep the commandbar specific instead to install the add-in on every computer
thanx for ur kind help and suggestions italkid
ill keep them in mind in the future
ciao
vit
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->