HELP: Excel userform version control issue

Hi All,

I have an excel userform that is posted on my companys intranet. The issue I 
am having is, users are saving this form to their hard drive and then using 
it(Instead of launching it everytime from intranet), SO  basically when I 
have a new version of form on intranet they still use the old version as they 
have a habbit of saving it on their hard drive. 

Is there a way to resove this? something like they would see a popup message 
saying that "This is an older version that you are using, Please launch the 
form from Intranet for newer version".

Thanks in advance
2/17/2010 9:17:01 PM
excel.programming 6508 articles. 2 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 28

Place the following code in the "ThisWorkbook" module of your master form.  
Set the value of the "masterFile" constant to whatever path you use for the 
master version of your form.  Then create a worksheet called "HiddenSheet".  
In cell A1, type the label "Version".  In cell A2, enter whatever you want 
the version number to be.  Then password protect that sheet and hide it.  
Provide this form to all your users.

When a user opens the form, the "Workbook_Open" routine will run and compare 
the version number of the user's file with the master.  If they don't match, 
the file will be closed.



Option Explicit

Private Const masterFile = "C:\myPath\Master.xls"

Private Sub Workbook_Open()
    Dim conData As Object
    Dim rstAssigns As Object
    Dim intCount As Integer
    Dim strSelect As String
    Dim strResults As String
    Set conData = CreateObject("ADODB.Connection")
    Set rstAssigns = CreateObject("ADODB.Recordset")
' Open a data connection to the "master" form so that we
' can check its version number without opening it.
    With conData
        .Provider = "Microsoft.Jet.OLEDB.4.0"
        .ConnectionString = "Provider=Microsoft.Jet.OLEDB" & _
         ".4.0;Data Source=" & masterFile & ";Extended " & _
         "Properties=""Excel 8.0;HDR=Yes"""
        .CursorLocation = 3
    End With
' The worksheet named "HiddenSheet" (no $) must be present in
' the "master" file, and on it must be the word "Version" in
' cell A1 and the version number (like 2.1) in cell A2.
    strSelect = "SELECT * FROM [HiddenSheet$]"
On Error GoTo Oops
' Open the recordset so we can read the version number
    rstAssigns.Open strSelect, conData, adOpenStatic, adLockReadOnly, 
On Error GoTo 0
    Do While Not rstAssigns.EOF ' We loop, but there is really on one entry
        For intCount = 0 To rstAssigns.Fields.Count - 1
' Check to see if the master version number and the version
' of this file are the same.
' rstAssigns.Fields(intCount).Name is the name of the field ("Version")
' rstAssigns.Fields(intCount).Value is the value of that field (the version 
            If (rstAssigns.Fields(intCount).Value <> 
Me.Sheets("HiddenSheet").Cells(2, 1)) Then
                MsgBox "Version Number in this file (" & 
Me.Sheets("HiddenSheet").Cells(2, 1) & ") " & Chr(10) & _
                       "does not match version number in master file (" & 
rstAssigns.Fields(intCount).Value & ")" & Chr(10) & Chr(10) & _
                       "Please acquire and use the latest version of the 
form." & Chr(10) & Chr(10) & _
                       "This file will now close." _
                       , vbOKOnly, "Mismatched Version Number"
                Me.Close SaveChanges:=False
            End If
' Close the data connection
    Set conData = Nothing
    Set rstAssigns = Nothing
    Exit Sub
    Debug.Print "Oops! Unable to read the master file's version number."
    Debug.Print "Error Message:  " & Err.Description
End Sub

2/18/2010 9:16:04 PM

Similar Artilces:

Looking for Excel Help
I'm a very novice Excel user and am looking for a little help with creating a formula for a spreadsheet I'm creating for my personal use. I would appreciate some assistance if possible. Thanks in advance. Dan --- Message posted from Hi Dan! Post a sample of what you want to do. Your question is just a tad open ended <g> -- Regards Norman Harker MVP (Excel) Sydney, Australia Excel and Word Function Lists (Classifications, Syntax and Arguments) available free to good homes. "DanB4105" <DanB4105.ywtpa@excelfor...

New to excel
Hi All, I'm new to Excel ( and to this forum :) ) and so I hope somebody may b able to help me. I've got 2 questions.... QUESTION 1 I've got a spreadsheet which takes data from one worksheet and uses i to calculate data in a second worksheet using the following code formula: =IF('4th November 2005'!B19="","nothing here dude",IF(B19<'4th Novembe 2005'!B19,"UP",IF(B19='4th November 2005'!B19,"Same",IF(B19>'4t November 2005'!B19,"DOWN")))) The problem is, when I create a new worksheet I have...

Need Help, Task Start Date is wrong
I’m using MS Project 2007, have several task linked with finish to start. I have set date to schedule from, hours per day set to 8 and Working Monday thru Friday. My schedule shows Task 1 Duration 4 days, start Wed 6/2/10, Finish Mon 6/7/10 Task 2 Duration 3 days, start Mon 6/7/10, Finish Thu 6/10/10 Task 2 should have a Start Date of 6/8/10 not 6/7/10; what is causing this? Thanks in advance for your help. ...

allowing relaying... security issues
We are using Exchange 2000 on an SBS 2000 machine. We signed up with Spam Soap - an outside company to provide incoming/outgoing SMTP mail filtering . As part of their service, you also configure them as a "smart host". This is configured in the virtual SMTP Server area - in the advanced options for delivery. Also, in order to have this work properly, the SMTP Connector we had configured in the 'Connectors' area also had to be removed. We have an in-house VB .net application that automatically sends auto-generated emails. This particular application is configured and...

Excel button problem
Hi All I have a macro that copies a worksheet in the active workbook and puts it into a new workbook - then formats it and deletes any buttons on the worksheet. On the first click on the button the macro works ok. On the second click, it fails because the all assigned macros on all buttons in the active workbook changed from "mba" to "book1!mba". Book 1 doesn't exists (wasn't opened, wasn't saved, doesn't have the macros). I've never experienced this problem before?? Can anyone help to solve this problem? FYI The macro to do this is c...

Excel 97 #9
Please can anyone help??? I have two columns in Excel 97. The first contains a list of statu values eg. pending, or granted or withdrawn. The second contains date eg.01/12/1997, 05/06/2003. I woudl like to know how to get all th granted apps before 31/12/2003. Can anyone help please -- Message posted from theres many ways, but an easiest way would be to do a sort. Highlight the 2 columns, click on data, then sort, then sort by status, then by date. this should group them all together. hope this helps...toe >-----Original Message----- >Please can anyo...

How do I Remove a Split from my Comments in Excel 2003? #2
I have set my current workbook to split/freeze the first column and first 2 rows. Now, when I add a comment to the second row (in any column) my comments are cut off if I should scroll down. I don't ever remember the behavior before. And I don't know what I've done to enable it but it's really annoying. How do turn this off ? ...

learning Excel #3
Hi, I was considering learning Excel as an additional tool for my data analysis work. Is it better to use data sets that I have previously used with SPSS and apply the same analysis tools as in SPSS? For applying the appropriate tools, I was considering using excel's online help. The second option I have is to use some excel book for data analysis and apply the techniques to data sets provided with the book. Any suggestions????? regards Metal ...

unable to paste Excel 2003 chart into Outlook 2003
(This was posted on "excel.charting" group.) I have a user who's unable to paste an Excel 2003 chart into Outlook 2003 email message. In Outlook options, the checkbox is selected for "Use Microsoft Office Word 2003 to edit e-mail messages". When I tested this on my own computer running the same version of Office, if the box is check, I have no problem pasting; if this box is cleared, I cannot paste. But on his computer, it doesn't work regardless. Thanks and regards, TL ...

mouse highlighting webbrowser control
Hi, I'm using the webbrowser control. Mouse highligting isn't working (ie. pressing and holding the left mouse button, moving over the items/text to highlight and releasing). Is this something I have to implement manually or is there another reason why this isn't working? Thanks, Craig ...

how to find an item in a list control?
hi all, In a list Control how to find an item. If it is found then the item should be highlighted. how to do this? i wrote the following code but its not working what's wrong in the code? LVFINDINFO info; int nIndex; info.flags = LVFI_PARTIAL|LVFI_STRING; info.psz = (LPCTSTR) str; //fd.m_strEditCtrl; sprintf(st,"%d",m_ListCtrl.GetItemCount()); MessageBox(st,"Count"); for(int i=0;i < m_ListCtrl.GetItemCount();i++) { if((nIndex = m_ListCtrl.FindItem(&info,-1)) == -1 ) { m_ListCtrl.SetItemState(nIndex,LVIS_SELECTED,LVIS_SELECTED); } } thanks and r...

Excel corrupts when asking to update vlookups
We are experiencing weird behavior with some Office 2K3 Excel spreadsheets that contain lots of calculations, but no macros. On some pc’s Excel acts normally, on others you get the error. I have a couple of screen shots available. Any help is appreciated. If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the subject line 3. You send a clear explanation of what you want 4. You send before/after examples and expected results. -- Don Gu...

Uninstall of mappoint has caused errors with excel
Hi, I am running Office 2003 on the terminal server (windows 2003) and had a copy of mappoint as well. This is a mapping program. We ininstalled mappoint which has caused an error message with Excel and other office products. The error says "Cd:\documents and settings\administrator.ocrdc1\application data\microsoft\addins c:\Program files\common files\microsoft shared\geography\mpoai9.dll is not a valid add-in." I then click OK and excel opens up and everything is fine. The problem is that we are using other programs as well such as Quickbooks that export to excel and t...

Please help #8
I have Exchange 2000 and Outlook 2003 in Cache mode. Has anyone seen this or know how to fix it? Task 'Microsoft Exchange Server' reported error (0x8007000E) : 'Out of memory or system resources. Close some windows or programs and try again.' "John S" wrote: > > I have Exchange 2000 and Outlook 2003 in Cache mode. Has anyone seen this or > know how to fix it? > > Task 'Microsoft Exchange Server' reported error (0x8007000E) : 'Out of > memory or system resources. Close some windows or programs and try again.' > >...

q Emailing Excel Sheet With Outlook
I am trying to send a table from Excel within the body of an Outlook (lastest versions) to be sent as a fax. Am able to do this, BUT when the document prints out on the fax machine the formating is off (too big for the sheet). I am flexible on changing the method I send it to the fax machine, however it must be sent to the fax via macro. Below is the code I am using. Any help would be greatly appreciated. David Public Sub DoIt() 'On Error GoTo Handler Dim EmailAddress(0 To 2) As String Dim Count As Integer Dim N As Integer Dim sRec1(0) As String Dim sRec2(0 To 1) As...

I need to print a word in PDF from excel.
Hi, In my excel Macro, I update several values and then open a word linked with that excel. Finally what I need to do is to print that word to PDF. I already have a PDF Printer, so I just need the code to do it. Can anybody help me? Thanks in advance. Gast=F3n. Habilita la impresora predeterminada como la PDF y ya lo puedes imprimir a al formato deseado Gracias Francisco,=20 Tienes alg=FAn codigo para ello? gracias Repitiendo: Desde el panel de impresoras asigno primero la que me interesa y despues ejecuto mi macro desde el archivo excel asignando la instruccion sig: midefaultes = a...

Excel VBA
When you select the autofilter, the drop down list is created from the unique data in that column. Is there any way to customize this list, so the changes are permanent? For instance, I might have in one(1) column the following 4 row entries: red, blue, green (all are single cell entries) red, blue red blue, green I want my autofilter drop down list to read: red instead of red, blue, green blue red, blue green red blue, green (like normal) If I chose red from the drop down list...

Problem with named range for a large spreadsheet in Excel 2007
Hello, I am trying to generate a large Excel spreadsheet apprx. 10000 rows and 40 columns. I am generating defined name section in the Workbook.xml part of the XLSM package. Here is a sample entry from that section <definedName name="_._44802_._0_._0_._0_._top_line" localSheetId="0" hidden="1">Sheet1!$B$2</definedName> Although the generation goes fine, I can not open the spreadsheet as the Excel throws an error message saying the package is corrupt. But this is not the case if the spreadsheet is small say, 200 rows by 10 columns. ...

How do I get Excell to sort dates that range from 1800 to 1900's
I have posted a cemetery survey on Excell spreadsheet. When I try to sort the birth dates or death dates in ascending or descending order the range of 1900 dates will sort but the 1800 dates fall after the 1900 and will not sort. Why? Is this inherit with this program? The WinXL default dates start with 31 December 1899, so earlier "dates" are interpreted as Text. You can use helper columns and text functions (LEFT(),RIGHT(),MID()) to put the Year, Month and Day in separate columns, then sort. Take a look here for additional workarounds:

how do I add error bars to a 3D chart in excel?
The help states you can only add error bars to data series in 2D area. Is there a way to add them to a 3D chart? Hi, I would not have thought so. Obviously as it is not a built-in option the only way would be a work around perhaps using dummy series. Unfortunately you can create 3d combination charts. Stick with the 2d view. Cheers Andy elahe wrote: > The help states you can only add error bars to data series in 2D area. Is > there a way to add them to a 3D chart? -- Andy Pope, Microsoft MVP - Excel I checked, and error bars are not offered for 3D ch...

Exchange 2007 Content Conversion/Encoiding issue.
Hello I have an Exchange 2007 RTM box running in a Windows 2003 only domain. When we scan a document from our Dell 1815n multifunction and have the output emailed, the document shows up as encoded garble instead of an attached document. A message header from a bad email is below. When we scan a document from the same device and send it to a mailbox that still lives on our last remaining Exchange 2003 server, the output from the scanner is attached as a PDF document normally. Any ideas? Thanks Michael Buckley Header from email recieved to Exchange 2007: (server names and I...

Help with importing data
Can I have users fill in a form in Access and have that data be transferred and updated to a spreadsheet. Need for fill out several fields and then export to a specific spreadsheet and place that data into the cells that will update that cell (add to the total in that cell) of a spreadsheet. ...

SQL 2005 Great Plains 9 issue
I will try to keep this succinct. I am running Great Plains 9 with SQL 2005 on separate servers. Recently I brought up a new SQL server(called sql02) to replace the old SQL server(called sql01). After installing SQL 2005 on the new server and restoring all the databases I renamed the new server(sql02) to the name of the old Server(sql01). Great Plains worked happily after that. On the new SQL server now called SQL01 there are two database engines in SQL Studio, one is called SQL02 and the other is called SQL01. I would rather not have SQL02 there, but I'm not sure how to delet...

Load image in a unbound control from a attachment field in recor
I have a unbound (single not continuious) form with 16 differant records from the same recordset. No problem loading the this data from recordset in VBA. PROBLEM I need to know how to load the unbound controls with Image's from an attachment field in another recordset The normal method of control = Rs!field does not work Please advise -- Thanks Tom dans l'article, Tom � a �crit le 21/01/08 20:28�: > I have a unbound (single not continuious) form with 16 differant records from > the same record...

Business Portal should allow requisition to be added to issued PO
The printing of a PO changes the status of the PO from New to Released (signifying the release of the PO to the vendor). Once a PO has been released, it will not show as a PO you can add items to from business portal. The current design of the product only allows you to add to POs with a status of New. Adding an item to a Released PO should trigger a change order. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not ...