[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Fwd: WG: unsubscribe / Contribution]

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Fri, 16 May 2008 11:11:45 +0200

Forwarding to dev list for review:

-------- Original Message --------
Subject: WG: unsubscribe / Contribution
Date: Thu, 15 May 2008 22:42:16 +0200
From: Michael Joras <michael.joras_at_attempto.eu>
To: 'Stefan Küng' <tortoisesvn_at_gmail.com>

Hi Stefan,

Thank you, that's it.

I just wanted to conrtibute some code.
I've got a bug in the diff script for excel. Actually only changes in
the first table in excel will be highlighted in red with the excel diff
script.
If you have got 2 or more tables, only the first table is highlighted,
the other ones not. Usually you don't expect these behavior.

So I've extended the diff script a little bit and now the highlighting
it works for all tables within one excel file.

Can you please forward the mail with the code?

Thanks,

Michi

------------------------------------------------------------------------------------------------------------------------------

dim objExcelApp, objArgs, objScript, objBaseDoc, objNewDoc, objWorkSheet, i

Set objArgs = WScript.Arguments
num = objArgs.Count
if num < 2 then
    MsgBox "Usage: [CScript | WScript] compare.vbs base.doc new.doc",
vbExclamation, "Invalid arguments"
    WScript.Quit 1
end if

sBaseDoc = objArgs(0)
sNewDoc = objArgs(1)

Set objScript = CreateObject("Scripting.FileSystemObject")
If objScript.FileExists(sBaseDoc) = False Then
     MsgBox "File " + sBaseDoc +" does not exist. Cannot compare the
documents.", vbExclamation, "File not found"
     Wscript.Quit 1
End If
If objScript.FileExists(sNewDoc) = False Then
     MsgBox "File " + sNewDoc +" does not exist. Cannot compare the
documents.", vbExclamation, "File not found"
     Wscript.Quit 1
End If

Set objScript = Nothing

On Error Resume Next
Set objExcelApp = Wscript.CreateObject("Excel.Application")
If Err.Number <> 0 Then
    Wscript.Echo "You must have Excel installed to perform this operation."
    Wscript.Quit 1
End If

'Open base excel sheet
objExcelApp.Workbooks.Open sBaseDoc
'Open new excel sheet
objExcelApp.Workbooks.Open sNewDoc
'Show Excel window
objExcelApp.Visible = True
'Create a compare side by side view
objExcelApp.Windows.CompareSideBySideWith(objExcelApp.Windows(2).Caption)
If Err.Number <> 0 Then
  objExcelApp.Application.WindowState = xlMaximized
  objExcelApp.Windows.Arrange(-4128)
End If

'Mark differences in sNewDoc red
i = 1

For Each objWorkSheet In objExcelApp.Workbooks(2).Worksheets

   objworksheet.Cells.FormatConditions.Delete

   objExcelApp.Workbooks(1).Sheets(i).Copy
,objExcelApp.Workbooks(2).Sheets(objExcelApp.Workbooks(2).Sheets.Count)

 
objExcelApp.Workbooks(2).Sheets(objExcelApp.Workbooks(2).Sheets.Count).Name
= "Dummy_for_Comparison" & i

   objworksheet.Activate
   'To create a local formula the cell A1 is used
   original_content = objworksheet.Cells(1,1).Formula
   String sFormula
   'objworksheet.Cells(1,1).Formula = "=INDIRECT(""" &
objExcelApp.Workbooks(2).Sheets(i).name & " (2)"&
"!""&ADDRESS(ROW(),COLUMN()))"
   objworksheet.Cells(1,1).Formula = "=INDIRECT(""Dummy_for_Comparison" &
i & "!""&ADDRESS(ROW(),COLUMN()))"
   sFormula = objworksheet.Cells(1,1).FormulaLocal

   objworksheet.Cells(1,1).Formula = original_content
   'with the local formula the conditional formatting is used to mark the
cells that are different
   const xlCellValue = 1
   const xlNotEqual = 4
   objworksheet.Cells.FormatConditions.Add xlCellValue, xlNotEqual, sFormula
   objworksheet.Cells.FormatConditions(1).Interior.ColorIndex = 3

  i = i + 1
next

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------
*Von:* Stefan Küng [mailto:tortoisesvn_at_gmail.com]
*Gesendet:* Donnerstag, 15. Mai 2008 19:47
*An:* Michael Joras
*Betreff:* Re: unsubscribe

Michael Joras wrote:
> Hi,
>
> the last three mails are from
> "Greg Thomas" <thomasgd_at_omc.bt.co.uk>
> "John BORIS" <jboris_at_adphila.org>
> "Richard Yale" <Richard.Yale_at_uk.linedata.com>
>
> the from address is always from users_at_subversion.tigris.org

Ahem: the list users_at_subversion.tigris.org belongs to the Subversion
project, not TortoiseSVN. There's nothing I can do to unsubscribe you.

Stefan

--
         ___
    oo  // \\      "De Chelonian Mobile"
   (_,\/ \_/ \     TortoiseSVN
     \ \_/_\_/>    The coolest Interface to (Sub)Version Control
     /_/   \_\     http://tortoisesvn.net
-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net

Received on 2008-05-16 11:12:00 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.