473,471 Members | 4,637 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is this possible?

15 New Member
I have an excel sheet distributed to mulitple people accross the country. If I want to update the VBA code behind their copys is there anyway of doing it via distributing another excel sheet to change it remotly? I do not want to have to collect in all the copys and each one varies slightly on the data it contains so i cant simply send out a replacement...
Jul 11 '08 #1
3 799
MikeTheBike
639 Recognized Expert Contributor
Hi

I suggest the easest way to do this is to distribute as xla (addin) worksheet/file.

This file would contain all the code and code similar (adapt to suit) to the code below to load a toolbar on the fly.

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2.  
  3.     Dim aToolBar As CommandBar
  4.     Dim aBtn As CommandBarControl
  5.     Dim aCtrl As CommandBarControl
  6.  
  7. Sub AddToolbar()
  8.  
  9.     On Error GoTo Bar_Exists
  10.  
  11.     Set aToolBar = CommandBars.Add(Name:="WIP Apps", Position:=msoBarFloating, MenuBar:=False, Temporary:=True)
  12.     aToolBar.Visible = True
  13.     aToolBar.Top = 130
  14.     aToolBar.Left = 625
  15.  
  16.     Set aBtn = aToolBar.Controls.Add(Type:=msoControlPopup, Temporary:=True)
  17.     aBtn.Caption = "WIP &Manipulation"
  18.     aBtn.Tag = "WIPMan"
  19.  
  20.  
  21.     With aToolBar.Controls(1).CommandBar.Controls
  22.         Set aBtn = .Add(Type:=msoControlButton, Temporary:=True)
  23.         aBtn.Caption = "&Remove Job Details "
  24.         aBtn.OnAction = "RemoveDetailsData"
  25.         aBtn.Style = msoButtonCaption
  26.  
  27.         Set aBtn = .Add(Type:=msoControlButton, Temporary:=True)
  28.         aBtn.Caption = "&Collate PPM && DW "
  29.         aBtn.OnAction = "CollatePPMnDW"
  30.         aBtn.Style = msoButtonCaption
  31.  
  32.         Set aBtn = .Add(Type:=msoControlButton, Temporary:=True)
  33.         aBtn.Caption = "&Delete Zero YTDS/YTDC"
  34.         aBtn.OnAction = "Delete_Zero_YTDS_YTDC"
  35.         aBtn.Style = msoButtonCaption
  36.  
  37.         Set aBtn = .Add(Type:=msoControlButton, Temporary:=True)
  38.         aBtn.Caption = "&Sort Margin"
  39.         aBtn.OnAction = "AllSheetMarginsSort"
  40.         aBtn.Style = msoButtonCaption
  41.     End With
  42.  
  43.     If Application.Version < 12# Then aToolBar.Visible = False
  44.  
  45. Exit Sub
  46.  
  47. Bar_Exists:
  48.  
  49. End Sub
In the ThisWorkbook module put this

Expand|Select|Wrap|Line Numbers
  1. Private Sub Workbook_Open()
  2.     On Error Resume Next
  3.     AddToolbar    
  4. End Sub
The xla file will can need installing in the XLStart directory, this will make the toolbar available at all time. Alternativley the people involved could just open the xla file when required!?

You will need code in you routines to check it is working on the correct workbook/sheet etc.

As it stands the toolbar will not be visible by default.
However, in Excel 2007 toolbars not longer exist (WHAT ON EATH ARE MICROSFT PLAYING AT !!?? - end of rant - for now...), so this line

If Application.Version < 12# Then aToolBar.Visible = False

makes it visible so it shown up in the Addin Ribbon in 2007 (otherwise it seems to be lost in the ether unless some knows otherwise - I have only 3 days on a 2007 PC, mostly on Access which seem even worse!!)

Sorry about the rant(s) but AHHHHH.......


HTH

ps May be we should have a 2007 work round section on the forum ??
Jul 11 '08 #2
debasisdas
8,127 Recognized Expert Expert
For your case the database and business logic should not be the part of the frontend.That should be residing separately, so that you can change the business logic independent of your application. It is really difficult ot achieve what you are tryin gto do using excel.
Jul 11 '08 #3
IceBower
15 New Member
For your case the database and business logic should not be the part of the frontend.That should be residing separately, so that you can change the business logic independent of your application. It is really difficult ot achieve what you are tryin gto do using excel.
Thanks mike, that seems to make sense and should work without to much effort.

Debasisdas, I would usually agree. I always keep the front end of my work seprate from the datasheets (and i tend to opt for Access over excel aswell). unfortunatly this is an existing projest that i have been asked to work on so my options are more limited.

Thanks both for your helpfull comments!

Bower
Jul 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Julia Briggs | last post by:
I am struggling to create a PHP function that would take a specified image (JPG, GIF or PNG) from a link, and resize it down to a thumbnail so it will always fit in a 200x250 space. I am hoping...
36
by: rbt | last post by:
Say I have a list that has 3 letters in it: I want to print all the possible 4 digit combinations of those 3 letters: 4^3 = 64 aaaa
20
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
7
by: Andrzej | last post by:
Is it possible to call a function which name is given by a string? Let assume that I created a program which call some functions for example void f1(void), void f2(void), void f3(void). ...
2
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens...
1
by: AAA | last post by:
hi, I'll explain fastly the program that i'm doing.. the computer asks me to enter the cardinal of a set X ( called "dimX" type integer)where X is a table of one dimension and then to fill it...
25
by: Piotr Nowak | last post by:
Hi, Say i have a server process which listens for some changes in database. When a change occurs i want to refresh my page in browser by notyfinig it. I do not want to refresh my page i.e....
4
by: RSH | last post by:
Okay my math skills aren't waht they used to be... With that being said what Im trying to do is create a matrix that given x number of columns, and y number of possible values i want to generate...
7
by: Robert S. | last post by:
Searching some time now for documents on this but still did not find anything about it: Is it possible to replace the entry screen of MS Office Access 2007 - that one presenting that default...
14
by: bjorklund.emil | last post by:
Hello pythonistas. I'm a newbie to pretty much both programming and Python. I have a task that involves writing a test script for every possible combination of preference settings for a software...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.