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
14 2002
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.
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.
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.
-
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
-
Dim W As Worksheet
-
Set W = Sh
-
Dim C As Range
-
Dim Fnum As Long
-
Fnum = FreeFile
-
Open "C:\Temp\ChangeLog.txt" For Append Access Read Write Lock Write As #Fnum
-
For Each C In Target.Cells
-
With C
-
'Debug.Print , W.Name, .Column, .Row, .Value, .Value2
-
Print #Fnum, W.Name; vbTab; .Column; vbTab; .Row; vbTab; .Formula; vbTab; .Value
-
End With
-
Next
-
Set W = Nothing
-
Set C = Nothing
-
Close #Fnum
-
End Sub
-
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.
-
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
-
Dim W As Worksheet
-
Set W = Sh
-
Dim C As Range
-
Dim Fnum As Long
-
Fnum = FreeFile
-
Open "C:\Temp\ChangeLog.txt" For Append Access Read Write Lock Write As #Fnum
-
For Each C In Target.Cells
-
With C
-
'Debug.Print , W.Name, .Column, .Row, .Value, .Value2
-
Print #Fnum, W.Name; vbTab; .Column; vbTab; .Row; vbTab; .Formula; vbTab; .Value
-
End With
-
Next
-
Set W = Nothing
-
Set C = Nothing
-
Close #Fnum
-
End Sub
-
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?
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.
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.
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.
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
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
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Eric Clapton |
last post by:
When should I use vb.net and when I should use c#.net? What is pros and
cons?
|
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
|
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?
|
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
|
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...
| |
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...
|
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)
|
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
|
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,...
|
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...
|
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...
| |
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...
|
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();...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |