473,657 Members | 2,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vb-how To Moniter Changes Made In Excel By Using Vb 6.0 Software

81 New Member
HI all,

I wanted to monitor changes made in any excel file of each and every cell by various users in networking system.

kindly provide some guidelines how to create the software.

Regards
Anup kumar
May 15 '07 #1
14 2002
Killer42
8,435 Recognized Expert Expert
I wanted to monitor changes made in any excel file of each and every cell by various users in networking system.

kindly provide some guidelines how to create the software.
It might be simplest to put something in the Worksheet_Chang e event of the worksheet(s) in question. For example, you could append an entry to a log (text) file each time.
May 16 '07 #2
smugcool
81 New Member
It might be simplest to put something in the Worksheet_Chang e event of the worksheet(s) in question. For example, you could append an entry to a log (text) file each time.

I didn't get dear.

Plz explain this thing in a bit more broadway. As i am very much new to Vb.
May 16 '07 #3
Killer42
8,435 Recognized Expert Expert
I didn't get dear.

Plz explain this thing in a bit more broadway. As i am very much new to Vb.
Ok, well in this case we'll actually be talking about VBA. That's "Visual Basic for Applications", which is a version of VB built into MS Office applications to do scripting (automating tasks) by writing "macro" code.

Let's have a go at throwing together a simple little example macro for Excel which will append the details of each change made to a worksheet into a text file.

To create this, follow the following steps. (Hopefully they won't vary too much on your system, but we'll see).
  • open a new worksheet in Excel.
  • Pull down the Tools menu, expand the [b]Macro submenu and select Visual Basic Editor.
  • In the Project Explorer window (the one probably at top-left which lists what's in the project) double-click on ThisWorkbook.
  • You should get a blank code window on the right.
  • At the top of the code window, pull down the left-hand listbox and select WorkBook.
  • Pull down the right-hand listbox and select SheetChange.
  • You are now in the code window for the workbook's SheetChange event procedure. Any code you enter here will be executed each time a change is made on any of the worksheets in this workbook.
  • Paste in the following code. This is a very simple example, but will provide you with a starting point. You can then take this code and play with it.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    2.   Dim W As Worksheet
    3.   Set W = Sh
    4.   Dim C As Range
    5.   Dim Fnum As Long
    6.   Fnum = FreeFile
    7.   Open "C:\Temp\ChangeLog.txt" For Append Access Read Write Lock Write As #Fnum
    8.   For Each C In Target.Cells
    9.     With C
    10.       'Debug.Print , W.Name, .Column, .Row, .Value, .Value2
    11.       Print #Fnum, W.Name; vbTab; .Column; vbTab; .Row; vbTab; .Formula; vbTab; .Value
    12.     End With
    13.   Next
    14.   Set W = Nothing
    15.   Set C = Nothing
    16.   Close #Fnum
    17. End Sub
    18.  
May 16 '07 #4
smugcool
81 New Member
Ok, well in this case we'll actually be talking about VBA. That's "Visual Basic for Applications", which is a version of VB built into MS Office applications to do scripting (automating tasks) by writing "macro" code.

Let's have a go at throwing together a simple little example macro for Excel which will append the details of each change made to a worksheet into a text file.

To create this, follow the following steps. (Hopefully they won't vary too much on your system, but we'll see).
  • open a new worksheet in Excel.
  • Pull down the Tools menu, expand the [b]Macro submenu and select Visual Basic Editor.
  • In the Project Explorer window (the one probably at top-left which lists what's in the project) double-click on ThisWorkbook.
  • You should get a blank code window on the right.
  • At the top of the code window, pull down the left-hand listbox and select WorkBook.
  • Pull down the right-hand listbox and select SheetChange.
  • You are now in the code window for the workbook's SheetChange event procedure. Any code you enter here will be executed each time a change is made on any of the worksheets in this workbook.
  • Paste in the following code. This is a very simple example, but will provide you with a starting point. You can then take this code and play with it.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    2.   Dim W As Worksheet
    3.   Set W = Sh
    4.   Dim C As Range
    5.   Dim Fnum As Long
    6.   Fnum = FreeFile
    7.   Open "C:\Temp\ChangeLog.txt" For Append Access Read Write Lock Write As #Fnum
    8.   For Each C In Target.Cells
    9.     With C
    10.       'Debug.Print , W.Name, .Column, .Row, .Value, .Value2
    11.       Print #Fnum, W.Name; vbTab; .Column; vbTab; .Row; vbTab; .Formula; vbTab; .Value
    12.     End With
    13.   Next
    14.   Set W = Nothing
    15.   Set C = Nothing
    16.   Close #Fnum
    17. End Sub
    18.  

Ya thanx dear its working. But there is one problem, since this file is in networking system, i wanted the name of the User who will modify these changes. Is It possible?
May 16 '07 #5
Killer42
8,435 Recognized Expert Expert
Ya thanx dear its working. But there is one problem, since this file is in networking system, i wanted the name of the User who will modify these changes. Is It possible?
Probably. Have a look through the properties that are available. Um... Application.Use rName might be what you want.
May 16 '07 #6
smugcool
81 New Member
Probably. Have a look through the properties that are available. Um... Application.Use rName might be what you want.

Thanx a lot Dude.Gr8 mind.It has worked.One more favour if you can.I also want the Date and Time of changes made.Plzzzzzzzz zz help.
May 17 '07 #7
Killer42
8,435 Recognized Expert Expert
Thanx a lot Dude.Gr8 mind.It has worked.One more favour if you can.I also want the Date and Time of changes made.Plzzzzzzzz zz help.
Check out the Now() function. And you may need to use Format() on it.

Um... Now is from VB6. In Excel, you might have to use something else. Check the doco for system date and time.
May 17 '07 #8
smugcool
81 New Member
Check out the Now() function. And you may need to use Format() on it.

Um... Now is from VB6. In Excel, you might have to use something else. Check the doco for system date and time.

many many thanx to you.Its working.See you later. Bye bye
May 17 '07 #9
smugcool
81 New Member
many many thanx to you.Its working.See you later. Bye bye

Hi,
Can u tell me now how can i get the "logfile" datewise.I mean i had specified a path of a text file.But is it not possible that certain VBA command can generate the text file automatcally datewise format.

Regards
Anup
May 19 '07 #10

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

Similar topics

5
306
by: Eric Clapton | last post by:
When should I use vb.net and when I should use c#.net? What is pros and cons?
14
1606
by: Don Wash | last post by:
Hi There! In C# you can use /// to add comments that can produce XML documentation. What about in VB???? Thanks, Don
4
1504
by: Tony Thijs | last post by:
C# or VB.net? When considering a complex Commerce Server clustered environment with over 500 K users expected, one of the fundamental choices to make is the programming language to be used. Which substantial advantages are there in c# over VB.NET that would be considered mission critical. There must be a dozen or so I guess. Or in other words, where and on what details does Visual Basic falls short in that environment?
5
1265
by: thomas | last post by:
Hello, I wonder if it is possible to include visual basic class to a C++ project within a solution. Thanks Thomas
64
3061
by: Milan | last post by:
Hello, I would like to ask you this question. I am experienced in programming in VBA and I want to upgrade my knowledge to Visual Studio 2005 now. I hesitate whether to aim to VB or C#. Since I am familiar with VBA I would like to choose VB but I heart from my colleagues that VB is a "dead" language and it will probably not be included in the next versions of Visual Studio anymore. Their other objection against VB is that VB is not...
4
1877
by: pcnerd | last post by:
I've been playing around with VB since version 3. I now have VB6 Learning Edition. I'm thinking about getting VB.NET Express Edition. I have a lot of demo programs for version 3 thru version 6. I realize that the convertor might not be able to convert the source code on the older demos. I would have to open every demo program in version 6 & save it in the VB6 format & then open the source code in VB.NEt & convert to VB.NET. I've read...
14
1793
by: John Smith | last post by:
Can someone convert from C# into VB this line for me: if (c is System.Web.UI.HtmlControls.HtmlForm)
3
1810
by: Dhananjay | last post by:
Hi All, I am facing problem when i am converting C#.net code(Delegate concept) into vb.net. I am unable to do that . Can someone help me to solve the problem. I am providing my C#.net code. ==================================my code is :- ====================================== static public List<MembershipUserWrapperGetMembers(bool
0
8316
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8610
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7345
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2735
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 we have to send another system
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.