 |
|
 |
This seems to be a small, very minor issue, but as I am just now testing this tool, it seems that if one module has a small change made to it, when I go to commit just that one module to the repository, I am told by the Tortoise UI that "No files were changed or added since the last commit....". If however, I go to commit all the modules, then it notices that that one module was indeed changed.... curious. Have you noticed that as well?
Also, I'm a bit confused about the Overlay Icons in Windows explorer. I followed your setup steps exactly. And after importing the .XLS file along with the .XLS.SRC folder, and then subsequently checking them out to an empty folder, only the .XLS.SRC folder has the expected Overlay Icon. And as I continue to modify that .XLS and its modules the Overaly Icon does not appear on the file but does appear on the .XLS.SRC folder. Do you have any idea why the .XLS file does not have that Overlay Icon? Have I possibly done something incorrect?
This is a Windows XP Pro SP3 machine with Subversion setup on a server and TortoiseSVN installed on the workstation.
|
|
|
|
 |
|
 |
At least as far as the Overlay Icons issue goes... that was easily remedied by changing the TortoiseSVN Settings and putting a checkmark by Network Drives. I'm still not sure why the folder had the right icons and the workbook did not, but in any case, that took care of that issue.
|
|
|
|
 |
|
 |
Just wanted to say this did everything I wanted, and more. Thanks.
|
|
|
|
 |
|
 |
Hello,
does anybody know how I can get keywords expanded in my VBA-modules?
I setup keyword expansion for *.bas within TSVN. This causes expansion in the files SourceTool handles. e.g. TestWorkbook.xls.src\Modul1.bas contains expanded keywords.
'$LastChangedDate: 2009-06-15 00:09:01 +0200 (Mo, 15 Jun 2009) $ '$Rev: 8 $
But in VB-editor I don't get the expanded keywords. Only the keywords themself. '$LastChangedDate$ '$Rev$
Thanks for any reply!!
|
|
|
|
 |
|
 |
Hi!
This is due to the fact that you have to reimport the Modules. Either you can do this manually by "opening" the files with the first button or it is done automatically when updating the files from the repository.
The source files on disk are just exported modules, when importing them again into Excel, the modules should contain everything that was changed outside (except module meta information, such as Attribute VB_.. entries and the like.
-regards, Roland
|
|
|
|
 |
|
 |
This is a great tool and it has been a life saver!
I just wanted to let you know that i have taken the liberty to add some new buttons to your toolbar. the revision graph and repobrowser!
|
|
|
|
 |
|
 |
good to hear that. I collect these ideas for the successor tool "OTSVN" (whenever I find the time to finish it).
-regards, Roland
|
|
|
|
 |
|
 |
This is definitely one of the most creative and helpful tools I've found in a long time. I noticed, though, that every time I perform a commit or diff, any .frx files show up as having changed, even if I haven't changed them (or made any changes to the entire file at all). Do you have any ideas how to fix this?
Zach
|
|
|
|
 |
|
 |
Sorry, there's no way to fix this as it is VBA behaviour to change a few bytes every time you export a userform to a frx (binary data in the form) file.
But as the frx file is binary anyway and therefore useless for source control, I tend to ignore it (however still put it under source control, as there are still sometimes changes to it).
-sorry, but that's it. Roland
|
|
|
|
 |
|
 |
From what I have seen while working with this code, this code will be a tremendous help in updating my excel spreasheets. However, I still couldn't figure out how to compare my existing spreadsheets and the previous versions. Help! please!
|
|
|
|
 |
|
 |
Hi kaifu!
Thanks for the nice words, however I have to make one thing clear: Sourcetool.xla is NOT for comparing Spreadsheets, rather for comparing the VBA code modules inside Excel Workbooks.
After having said that, the following procedure can be used to compare different versions of code modules.
Go to the .xls.src folder that was created during the initial save of the code module and put under version control using Tortoise SVN as described. Using the Tortoise SVN (version 1.5.3 and above) context menu of that folder, use "Show Log" to display all versions of the repository.
You can then use the topmost part of the log messages window to compare either the various versions with the working copy in your local checkout folder (context menu "compare with working copy") or with the respective previous version (context menu "compare with previous version").
-regards, Roland
|
|
|
|
 |
|
 |
It will be very nice so that you see the svn source control status right in VBE without going to Windows Explorer.
Also inspired by Rob Bovey's CodeCleaner, I implemented an also identical program (functionality-wise) for SourceSafe using its API, but since has been looking for a way to override the icons...
Thanks,
Steven
modified on Friday, October 17, 2008 5:49 PM
|
|
|
|
 |
|
 |
After some research I found some more information regarding this:
Tortoise SVN has a project dedicated to icons at here: TortoiseOverlays it utilizes windows shell's internal support for icon overlays as well as windows registry to achieve this.
Through a combination of windows control API (comctl32.dll) calls (TreeView_GetImageList, ImageList_AddIcon, and ImageList_SetOverlayImage), I was able to overlay an icon image on top of a tree node within the project explorer treeview control.
|
|
|
|
 |
|
 |
Dear Steven!
Great! Would love to hear more about that, as I'm also trying to make the new subversion addin (also for other office VBA parts, Word, powerpoint, access...) a bit more slick.
-regards, Roland
|
|
|
|
 |
|
 |
Hi, I set breakpoints to each SUB in MExportImport when i click Save the code is never executed
when i manually start "saveto()" your code exports MExportImport, nothing more.
I set up the paths and the "security setting", do i need something else?
|
|
|
|
 |
|
 |
Well, which Office version/part of Office are you using it in?
-regards, Roland
|
|
|
|
 |
|
 |
I'm using Excel 2003, but now save works, don't know why, just reinstalled your code one more time and changed nothing in the settings.
tried this several times before and did not work...
now going to test everything else..
just one last short question,
your tool also exports the workbooks als .xwk files. since my code is jusst in a xla and not inside a workbook, can i turn this off?
|
|
|
|
 |
|
 |
Hi Sebastian!
Glad to hear it works now!
Concerning your question: In Module MExportImport, procedure exportComponent you can easily change the code to exclude all modules of type vbext_ct_Document:
Select Case cmpComponent.Type Case vbext_ct_ClassModule szFilename = szFilename & gszEXT_CLASS Case vbext_ct_MSForm szFilename = szFilename & gszEXT_FORM Case vbext_ct_StdModule szFilename = szFilename & gszEXT_MODULE Case vbext_ct_Document szFilename = szFilename & gszEXT_DOC End Select ' insert following If statement... If Not cmpComponent.Type = vbext_ct_Document Then cmpComponent.Export wbPath & folderExtension & gszSEP & szFilename End If
-regards, Roland
|
|
|
|
 |
|
 |
I can't get it to work in office 2007. What path does it use to store the files? Where does it go in the repository?
Does it automatically create the required Directory structures? or do we have to import and create the structure in the SVN repo first?
|
|
|
|
 |
|
 |
Hi!
I'm not quite sure whether you're familiar with Tortoise SVN, so maybe for a first hint you might go for the Tortoise Manual.
So the first thing to do is to save the sources of the project by clicking the second button. This should create a directory called ".src" with all components of your project as text files in it (named .bas for plain modules, .cls for classes, .frm/.frx for userforms and .xwk for the Workbook's and Worksheet's code). So essentially everything you would get when exporting your components indiviually.
Then you should import BOTH the Workbook/Addin AND the .src folder into a repository of your choice (on sourceforge.net or your private/local one (that's when you need to download svn itself, in case you don't want/need a repository for yourself, forget the SVN download, Tortoise is enough).
After that, DELETE the Workbook/Addin AND the .src folder (or better, move them into a safe place, if the following checkout fails). Once you have deleted these files/folder, then CHECKOUT the files you have just imported into the folder (or any other folder, but that means you're changing the location of your addin/workbook).
Bear in mind, this is ALL still done OUTSIDE the sourcetool, using plain Tortoise functionality.
Now you're ready to use the SourceTool: Simply edit your project in the way you were used to, once finished click the commit button on the sourcetool toolbar in the VBA-IDE (button five from the left) and you'll be presented the Tortoise commit dialog, showing either 1) all the components that changed since the last update (in case you selected the project node) 2) just the component that you selected (if changed, if it's up to date, Tortoise will tell you so)
Of course I still can't tell you whether all that works in OFfice 2007, but I'd be curious if it did as I heard there were serious changes to the way you write add-ins, so my Add-in might be affected as well.
-regards, ROland.
|
|
|
|
 |
|
 |
Thanks for the instructions... i figured it out after reading the posts below... this is not at all clear (the initial setup of the SVN space) from the instructions in the article. Can you update it?
Anyway thanks for the great add-in. It installed fine in 2007, and created the sources correctly. Now i've to test everything else .
Btw, couldn't you make setting up the paramters a default practice in the Install add_in event? That way whenever a user installed the add in he would have to choose the paths ...etc. But nm i guess it's not worth the extra effort.
|
|
|
|
 |
|
 |
I installed all the necessary components and am a bit confused on how to use this with an existing XLA file. Do I first have to export the code to a .BAS file, then import using TortoiseSVN? I can't seem to figure out a way to open and save, what less commit to the DB.
I've figured out how to use TortoiseSVN to manually manage the source code, but the interface from the VBE is not working. Whenever I open or save, I'm getting an error "couldnt determine path of project: path not found". I checked the MGLOBALS variables, and they are all changed correctly for the SubVersion and TortoiseSVN paths.
Am I missing a config param somewhere? Help would be appreciated. Thanks.
Pilotac
|
|
|
|
 |
|
 |
Hi Pilotac!
Sorry, I didn't mention how to do the preparation, it involves a bit of manipulation directly with TortoiseSVN. However, essentially you're right about the principle of committing the source code of a workbook/addin, although the saving is done automatically when committing to the repository.
First you export the modules with the "save" button. This creates a .xla.src folder in the same directory as your xla.
Next you import this folder into a repository already available.
The final step of the preparation is to check out the sources from the repository into the .xla.src folder back again. Don't forget to delete all the files before checking out, otherwise you will get a conflict message...
After these steps, you can simply check in and check out directly from the VBIDE.
The "couldnt determine path of project: path not found" error message you got was maybe arising from the fact that you didn't save the workbook before:
... Err.Clear wbPath = wbproj.FileName Set cmpComponents = wbproj.VBComponents
If Err <> 0 Then MsgBox "couldn't determine path of project: " & Err.Description, vbCritical setwbPathAndName = False End If
This part gets the path for the project and if the workbook hasn't been saved, this will fail...
-regards, Roland
|
|
|
|
 |
|
 |
Bingo! That worked. Thank you! My problem was that I was going into the VBE and selecting the module, not the XLA, and for some reason that did not work.
Now that I've been dorking around with this for awhile, I need to clean out my SVN repository and setup the correct file structure. Is there a way to do that easily? Can I just delete folders in TortoiseSVN? Can I delete the whole repository and start over?
Probably a good suggestion would be to add your instructions you sent me yesterday to the Code Project page with your SourceTools.XLA instructions.
Thanks. This is a great tool. I've struggled with source code control for awhile.
Pilotac
|
|
|
|
 |
|
 |
Well, there is a repo broswer (I use tortoiseSVN 1.4.3), where you can delete all the files inside a repository quite easily (multi-select and context menu "delete").
I'll add the instructions when I post the new version which should work for both excel and word (using a com-addin)...
-regards, ROland
|
|
|
|
 |