[SOLVED] 32 bit winmerge Help needed


"Excel VBA Help"

 


Play Friv Now - Play Friv Games
Go Back   The Code Cage Forums > Microsoft Topics > Microsoft Excel Forum
Our Info Pages:-
The Code Cage - Microsoft Office help

Notices

Microsoft Excel Forum Members Post questions in this forum if they are related to using Microsoft Excel, this includes Worksheet Functions, Excel VBA Programming, Simple Macro Code & Charting, Excel formula etc.

New Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 16th May 2014, 20:14
LisaGreen's Avatar
LisaGreen LisaGreen is offline
Solution Centre Professional
MS Office Version: MS Office 97, 2003, 2007,2010
MS Office Skill Level: Can use VBA
 
Join Date: Jun 2011
Location: Houten, Nederlands
Age: 65
Posts: 568
Posts Per Day: 0.25
My Top Tip Count: 1
Thanks to others: 9
Thanked 18 Times in 16 Posts
Reputation: 270 (14) LisaGreen is a jewel in the roughLisaGreen is a jewel in the roughLisaGreen is a jewel in the rough
1 Top Tips
Great_Britain
Default 32 bit winmerge Help needed
     Excel: VBA   


------ Register to get rid of these "In Post" ads! ------

Category: Excel: VBA   

Hi everyone...

I er... need some help.

I'm trying to shell to winmergeU from VBA and it won't work!
I keep getting "File not found".

I thought at first it was because the filenames I was trying to compare contained spaces so I put the filenames in quotes. No joy.

Then I thought maybe it needs a full path so I determined that and guess what... still got the same prob.

So I had a little think and I said right Fred... I've got a sorta feeling... hehehe.

I deleted both the filenames.

I got the same problem. I was getting a File not found on the winmerge call not either of the files I wanted to compare.

I looked at the path... remember that?... and found where winmergeu was and the path wasn't in the path variable... if you get my drift. So I added it. This is windows 8 so google was my friend.

Still didn't work. Strangely enough it did from a command prompt... after I'd changed the path.

The only way it seems I can invoke winmergeu from VBA is by including the path to the EXE file in the shell command.

I'm using a 64 bit operating system and winmerge installs to C:\Program Files (x86)\WinMerge\winmerge... but I don't have the 32 bit path :-(

So my question... finally woman!! I hear you say..... is if anyone has winmerge on a 32 bit system I'd really appreciate then path of the EXE so I can put it in as an alternative.

Phew!!

BTW If you are a developer of any sort and haven't seen winmerge I *strongly* suggest you have a look.

TIA
Lisa

The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!

  #2  
Old 22nd May 2014, 12:47
LisaGreen's Avatar
LisaGreen LisaGreen is offline
Solution Centre Professional
MS Office Version: MS Office 97, 2003, 2007,2010
MS Office Skill Level: Can use VBA
 
Join Date: Jun 2011
Location: Houten, Nederlands
Age: 65
Posts: 568
Posts Per Day: 0.25
My Top Tip Count: 1
Thanks to others: 9
Thanked 18 Times in 16 Posts
Reputation: 270 (14) LisaGreen is a jewel in the roughLisaGreen is a jewel in the roughLisaGreen is a jewel in the rough
1 Top Tips
Great_Britain
Default Re: 32 bit winmerge Help needed

------ Register to get rid of these "In Post" ads! ------


Hi,

I finally realised that the path would be to "Program Files"... at least I think it should be so that's the one I'm going to use.

Lisa

  #3  
Old 24th May 2014, 13:10
Jack in the UK's Avatar
Jack in the UK Jack in the UK is offline
The Code Cage Staff
MS Office Version: MS Office 97, 2003, 2007,2010
MS Office Skill Level: Proficient with Excel
 
Join Date: Dec 2011
Location: England
Posts: 545
Posts Per Day: 0.26
My Top Tip Count: 0
Thanks to others: 3
Thanked 43 Times in 43 Posts
Reputation: 570 (16) Jack in the UK is a name known to allJack in the UK is a name known to allJack in the UK is a name known to allJack in the UK is a name known to allJack in the UK is a name known to allJack in the UK is a name known to all
England
Default Re: 32 bit winmerge Help needed

------ Register to get rid of these "In Post" ads! ------


Lisa
Can you not install WinMerge on a 32 bit system?

Or - write a function to check Win OS and bit rate and error capture i.e. 32 bit is no go

Reason I say is you can not equate for custom installs
__________________
VBA CODE:
Regards, 
Jack In the UK 

The Code Cage Advertisment
Advertisement
  #4  
Old 24th May 2014, 16:21
LisaGreen's Avatar
LisaGreen LisaGreen is offline
Solution Centre Professional
MS Office Version: MS Office 97, 2003, 2007,2010
MS Office Skill Level: Can use VBA
 
Join Date: Jun 2011
Location: Houten, Nederlands
Age: 65
Posts: 568
Posts Per Day: 0.25
My Top Tip Count: 1
Thanks to others: 9
Thanked 18 Times in 16 Posts
Reputation: 270 (14) LisaGreen is a jewel in the roughLisaGreen is a jewel in the roughLisaGreen is a jewel in the rough
1 Top Tips
Great_Britain
Default Re: 32 bit winmerge Help needed

------ Register to get rid of these "In Post" ads! ------


Hi Jack,

Yes.. it installs on 32 bit system. I'm sort of assuming it goes into Program files because I didn't get an answer to my post.

On a 64 bit system... which my lappie is... it installs to ...
C:\Program Files (x86)\WinMerge\


FYI... Here is the code I've settled on.

Hugs..
Lisa

VBA CODE:
Private Sub cmdWinMerge_Click() 
     
    Dim lnglN As Long 
    Dim slFileName1 As String 
    Dim slFileName2 As String 
    Dim slFileNameRoot As String 
    Dim tslTextStream As TextStream 
    Dim OLfso As FileSystemObject 
    Dim vlShellReturn As Variant 
    Dim slSavePath As String 
    Dim slShellString As String 
    Dim slDQ As String 
    Dim lnglErrNumber As Long 
     
    slDQ = Chr$(34) 
     
    Set OLfso = CreateObject("Scripting.FileSystemObject") 
     
    slSavePath = fncGetSavePath() 
     
    slFileNameRoot = slSavePath & "\WinMerge" & Format(Now(), "yyyymmdd") 
    slFileName1 = slFileNameRoot & "A.txt" 
    slFileName2 = slFileNameRoot & "B.txt" 
     
     ' Create a text file.
    Set tslTextStream = OLfso.CreateTextFile(slFileName1, True) 
    tslTextStream.Close 
     
     ' Open a TEXT STREAM to a file.
     ' Appending = 8.
     ' Read = 1.
     ' Write = 2
    Set tslTextStream = OLfso.OpenTextFile _ 
    (slFileName1, 8, True) 
     
     ' Write Code to STREAM.
    For lnglN = 0 To Me.lstProcedure1.ListCount - 1 
         
        tslTextStream.WriteLine Me.lstProcedure1.List(lnglN, 1) 
         
    Next lnglN 
    tslTextStream.Close 
     
    Set tslTextStream = OLfso.CreateTextFile(slFileName2, True) 
    tslTextStream.Close 
     
    Set tslTextStream = OLfso.OpenTextFile _ 
    (slFileName2, 8, True) 
     
    For lnglN = 0 To Me.lstProcedure2.ListCount - 1 
         
        tslTextStream.WriteLine Me.lstProcedure2.List(lnglN, 1) 
         
    Next lnglN 
    tslTextStream.Close 
     
    On Error Resume Next 
    vlShellReturn = _ 
    Shell("C:\Program Files (x86)\WinMerge\winmergeU" _ 
    & " " _ 
    & slDQ & slFileName1 & slDQ _ 
    & " " _ 
    & slDQ & slFileName2 & slDQ _ 
    , _ 
    vbMaximizedFocus) 
    lnglErrNumber = Err.Number 
    On Error Goto 0 
    Select Case lnglErrNumber 
    Case 30872 
         ' OK.
    Case Else 
         
         ' Try 32 bit.
        On Error Resume Next 
        vlShellReturn = _ 
        Shell("C:\Program Files\WinMerge\winmergeU" _ 
        & " " _ 
        & slDQ & slFileName1 & slDQ _ 
        & " " _ 
        & slDQ & slFileName2 & slDQ _ 
        , _ 
        vbMaximizedFocus) 
        lnglErrNumber = Err.Number 
        On Error Goto 0 
        Select Case lnglErrNumber 
        Case 30872 
             ' OK.
        Case Else 
             
            subMsgBox "@Sorry.. WinMerge doesn't appear to be installed in..." _ 
            & vbNewLine _ 
            & "C:\Program Files\WinMerge\winmergeU" _ 
            & vbNewLine _ 
            & "http://sourceforge.net/projects/winmerge/" 
             
        End Select 
         
    End Select 
     
     ' *********************************************************************
End Sub 


Last edited by LisaGreen; 24th May 2014 at 16:27.
  #5  
Old 26th May 2014, 15:47
Jack in the UK's Avatar
Jack in the UK Jack in the UK is offline
The Code Cage Staff
MS Office Version: MS Office 97, 2003, 2007,2010
MS Office Skill Level: Proficient with Excel
 
Join Date: Dec 2011
Location: England
Posts: 545
Posts Per Day: 0.26
My Top Tip Count: 0
Thanks to others: 3
Thanked 43 Times in 43 Posts
Reputation: 570 (16) Jack in the UK is a name known to allJack in the UK is a name known to allJack in the UK is a name known to allJack in the UK is a name known to allJack in the UK is a name known to allJack in the UK is a name known to all
England
Default Re: 32 bit winmerge Help needed

------ Register to get rid of these "In Post" ads! ------


Hi Lisa, looking good nice error traps

Is this a typo
VBA CODE:
subMsgBox "@Sorry.. WinMerge doesn't appear to be installed in..." 
__________________
VBA CODE:
Regards, 
Jack In the UK 

  #6  
Old 26th May 2014, 20:02
LisaGreen's Avatar
LisaGreen LisaGreen is offline
Solution Centre Professional
MS Office Version: MS Office 97, 2003, 2007,2010
MS Office Skill Level: Can use VBA
 
Join Date: Jun 2011
Location: Houten, Nederlands
Age: 65
Posts: 568
Posts Per Day: 0.25
My Top Tip Count: 1
Thanks to others: 9
Thanked 18 Times in 16 Posts
Reputation: 270 (14) LisaGreen is a jewel in the roughLisaGreen is a jewel in the roughLisaGreen is a jewel in the rough
1 Top Tips
Great_Britain
Default Re: 32 bit winmerge Help needed

------ Register to get rid of these "In Post" ads! ------


Hey Jack,

Why do you think it might be??

Lisa

The Code Cage Advertisment
Advertisement
  #7  
Old 26th May 2014, 20:25
LisaGreen's Avatar
LisaGreen LisaGreen is offline
Solution Centre Professional
MS Office Version: MS Office 97, 2003, 2007,2010
MS Office Skill Level: Can use VBA
 
Join Date: Jun 2011
Location: Houten, Nederlands
Age: 65
Posts: 568
Posts Per Day: 0.25
My Top Tip Count: 1
Thanks to others: 9
Thanked 18 Times in 16 Posts
Reputation: 270 (14) LisaGreen is a jewel in the roughLisaGreen is a jewel in the roughLisaGreen is a jewel in the rough
1 Top Tips
Great_Britain
Default Re: 32 bit winmerge Help needed

------ Register to get rid of these "In Post" ads! ------


Hi Jack,

My personal take on errors is to try to deal with them when they happen and not to have a catch all error method. I think they just obfuscate things... In VBA anyway... Even if you add line numbers you just get a line number back and an error code. To be comprehensive you need to add a sort of FIFO stack so you know where you are. All that just adds to the the complexity which I personally can do without!!! I'm a simple gal really. Most coders are aware of where a problem may be... file access, zero length strings, funny characters in strings... a lot of it is in the data... so if you look to that stuff then you're quids in. *But* you do have to check some stuff out! If you do a decent job of testing... and I'm not saying I do!!... there are always surprises!... I think problem areas sort of shout "Here!!! Here I am!!! Take care of me!!!"

I used a proc out of the add in to insert that code around the place an error my happen... hehehe ... and then tuned it for the error number.

I think I may offer that as a separate download after your comment. Thank you!!!

Hugs.... Lisa

The Code Cage Advertisment
Advertisement
New Reply
The Code Cage at Facebookhe Code Cage at Twitter


Tags
bit, needed, winmerge

Thread Tools
Display Modes 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

Forum Jump

The Code Cage Affilliates



http://www.thecodecage.com/forumz tested by McAfee Security http://www.thecodecage.com/forumz tested by McAfee Security

All times are GMT +1. The time now is 16:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Template-Modifications by TMS
No part of this board, functionality or creatives may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
Copyright ©2008 - , Simon lloyd.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application they represent and are used with permission from Microsoft
UA-8135493-1
Cultural Forum | Study at Malaysian University
X vBulletin 3.8.7 Debug Information
  • Page Generation 0.23995 seconds
  • Memory Usage 6,568KB
  • Queries Executed 17 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footerEnd
  • (1)ad_footerStart
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_headerEnd
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_leftcolumn_code
  • (1)ad_navbar_below
  • (4)ad_postbit_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (7)helpful_answers
  • (1)helpfulanswers_javascript
  • (1)navbar
  • (3)navbar_link
  • (2)navbar_noticebit
  • (41)option
  • (7)post_thanks_box
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_ctoptip
  • (7)postbit_onlinestatus
  • (27)postbit_reputation
  • (7)postbit_wrapper
  • (1)showthread_changepostsowner_link
  • (1)showthread_extra_fields
  • (1)showthread_quickreply_mrgdp
  • (1)showthread_reason_popup
  • (1)spacer_close
  • (1)spacer_open
  • (1)su_form
  • (3)tagbit
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_datastore.php
  • ./includes/class_hook.php
  • ./awcoding/plugins/awc.php
  • ./awcoding/plugins/ds.php
  • ./awcoding/plugins/ss.php
  • ./includes/functions_notice.php
  • ./mobiquo/smartbanner.php
  • ./mobiquo/include/classTTConnection.php
  • ./mobiquo/smartbanner/head.inc.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/vbatags.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php
  • ./includes/functions_misc.php 

Hooks Called:
  • init_startup
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_check_criteria
  • notices_noticebit
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • helpfulanswers_showthreadorpost
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • helpfulanswers_show_normal
  • reputation_power
  • reputation_image
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • error_fetch
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete