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

Re: AW: AW: AW: SubWCRev program no more supporting VBA in V1.9x ?

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Tue, 30 May 2017 21:41:01 +0200

On 30.05.2017 13:32, Matthias Schäfer wrote:
> Dear Mr. Kueng,
>
> after some researches i can definitely say, that the method _.GetWCInfo_
> (_Svn.GetWCInfo ActiveWorkbook.FullName, 1, 1) _is causing the error and
> only in conjunction with the VBA-Sub _Private Sub
> Workbook_WindowActivate(ByVal Wn As Window)_ and only in the new version.
>
> The reason could be: while activating the template in excel this error
> occurs, because there is not an information from the excel file, which
> has no file location until it is saved.
>
> (But remembering its working with version 1.7X). The method should have
> an exit, if there is no info. How is it possible to get an result from
> the method?
>
> I tried MsgBox, Variable and Debug.Print. Nothing is working.
>
> He is the shortest possible sub I made for testing:__
>
> __
>
> __
>
> ·The rrror occurs only in the new version
>
> oOn “Error GoTo” is not Working in this case
>
> o“If oSvn.IsSvnItem = True Then Else” etc. is not working
>
> The documentation says:
>
> “Naturally you must call this before you can access the information
> using the remaining methods.”
>
> https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-subwcrev-com-interface.html
>
> So is this method really necessary? I made some tests without this
> method, I think it´s working without it?!

If you don't call this method, the other methods will return only
default values.

> If you want to test, please try this in _Excel _(Word same problems, but
> not examined in closer detail):
>
> Private Sub Workbook_WindowActivate(ByVal Wn As Window)
>
> On Error GoTo Err
>
> Dim oSvn As Object
>
> Set oSvn = CreateObject("SubWCRev.object.1")
>
> oSvn.GetWCInfo ActiveWorkbook.FullName, 1, 1

I could reproduce the problem: you mentioned that "has no file location
until it's saved". Which means you pass an invalid (empty) path to
GetWCInfo.
I've fixed the problem in r27849, but until the next release, you should
check for valid paths yourself:

Set svnPath = ActiveWorkbook.FullName;
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(svnPath)) Then
   oSvn.GetWCInfo svnPath, 1, 1
End If

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest interface to (Sub)version control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3241188
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2017-05-30 21:41:14 CEST

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

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