PC Review


Reply
Thread Tools Rate Thread

Comparing 2 different work books

 
 
Chris
Guest
Posts: n/a
 
      16th Jan 2008
Hi all,

If I want to compare 2 word docs and highlight the differences between them
I use:

Sub IsDocument_Equal()

Dim oDoc1 As Word.Document
Dim oResDoc As Word.Document

' Delete the tables from both the document

' Delete the images from both the document

' Replace Paragraphs etc

Set oDoc1 = ActiveDocument

' comparing Document 1 with New 1.doc
oDoc1.Compare Name:="C:\New 1.doc", CompareTarget:=wdCompareTargetNew,
DetectFormatChanges:=True

'This will be the result document
Set oResDoc = ActiveDocument

If oResDoc.Revisions.Count <> 0 Then
'Some changes are done
MsgBox "There are Changes "
Else
MsgBox "No Changes"
End If

End Sub

Is there a methos I can use to compare / identify the changes bewteen 2
different excel workbooks?

TIA
Chris

 
Reply With Quote
 
 
 
 
CLR
Guest
Posts: n/a
 
      16th Jan 2008
Jim Cone has a nifty commercial Add-in that I use to compare workbooks. It's
called XLCompanion, and is available at

http://www.realezsites.com/bus/primitivesoftware/

Vaya con Dios,
Chuck, CABGx3



"Chris" wrote:

> Hi all,
>
> If I want to compare 2 word docs and highlight the differences between them
> I use:
>
> Sub IsDocument_Equal()
>
> Dim oDoc1 As Word.Document
> Dim oResDoc As Word.Document
>
> ' Delete the tables from both the document
>
> ' Delete the images from both the document
>
> ' Replace Paragraphs etc
>
> Set oDoc1 = ActiveDocument
>
> ' comparing Document 1 with New 1.doc
> oDoc1.Compare Name:="C:\New 1.doc", CompareTarget:=wdCompareTargetNew,
> DetectFormatChanges:=True
>
> 'This will be the result document
> Set oResDoc = ActiveDocument
>
> If oResDoc.Revisions.Count <> 0 Then
> 'Some changes are done
> MsgBox "There are Changes "
> Else
> MsgBox "No Changes"
> End If
>
> End Sub
>
> Is there a methos I can use to compare / identify the changes bewteen 2
> different excel workbooks?
>
> TIA
> Chris
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: comparing work books JLGWhiz Microsoft Excel Programming 1 10th Jun 2009 09:05 PM
macro for comparing fields in two work books Sunny Microsoft Excel Discussion 2 11th Jun 2008 11:06 AM
Comparing work books Mag\(\)\(\) Microsoft Excel Discussion 2 26th Feb 2006 05:10 AM
macro for comparing fields in two work books Sunny Microsoft Excel Discussion 1 30th Sep 2004 08:43 PM
Comparing 2 works books Rich Microsoft Excel Misc 2 6th Jan 2004 09:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:44 PM.