Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source-control gives error and removes userform from project when there's no content #2706

Closed
fitzcee opened this issue Feb 17, 2017 · 6 comments · Fixed by #3129
Closed
Labels
bug Identifies work items for known bugs feature-source-control

Comments

@fitzcee
Copy link

fitzcee commented Feb 17, 2017

I'm new to rubberduckvba. Just installed for first time, so maybe I'm missing something easy.

Source control is removing my userforms. It is correctly handling all other modules and class modules, but deletes forms. Any assistance is appreciated.

Steps to reproduce:

  1. create new workbook
  2. open vba ide
  3. insert userform
  4. save xlsm workbook
  5. source-control -> Manage -> initialize new repository
  6. pick location and click OK
  7. receive error in source-control pane: "Unknown exception. Document-type component UserForm1 does not exist. Cannot import code from repository. Document-type component UserForm1 does not exist. Cannot import code from repository. Dismiss" (note: not a typo, warning sentence is repeated twice in the app)
  8. Userform has been deleted from vba project

Windows 10
Excel 2010
Rubberduckvba 2.0.12.2453

RubberduckLog.txt
2017-02-17 14:56:20.2784;INFO-2.0.11.2453;Rubberduck.App;Rubberduck version 2.0.11.2453 loading:
Operating System: Microsoft Windows NT 6.2.9200.0 x64
Host Product: Microsoft Office 2010 x64
Host Version: 14.0.7177.5000
Host Executable: EXCEL.EXE;

@retailcoder retailcoder added bug Identifies work items for known bugs critical Marks a bug as a must-fix, showstopper issue feature-source-control labels Feb 17, 2017
@retailcoder
Copy link
Member

Is there a UserForm1.frm file in the repository location?

@retailcoder
Copy link
Member

Wait a minute, document-type isn't normal, that would be for worksheet/workbook modules...

@retailcoder
Copy link
Member

repro log:

2017-02-17 18:11:43.1688;DEBUG-2.0.12.26410;Rubberduck.UI.Command.MenuItems.ParentMenus.ParentMenuItemBase;(20292006) Executing click handler for menu item '&Source Control', hash code 25013317;
2017-02-17 18:13:45.7680;TRACE-2.0.12.26410;Rubberduck.UI.SourceControl.SourceControlViewViewModel;Initializing repo;
2017-02-17 18:13:46.3201;TRACE-2.0.12.26410;Rubberduck.UI.SourceControl.SourceControlViewViewModel;Provider changed;
2017-02-17 18:13:46.3591;TRACE-2.0.12.26410;Rubberduck.UI.SourceControl.ChangesViewViewModel;Refreshing view;
2017-02-17 18:13:46.5731;TRACE-2.0.12.26410;Rubberduck.UI.SourceControl.BranchesViewViewModel;Provider changed;
2017-02-17 18:13:46.6361;TRACE-2.0.12.26410;Rubberduck.UI.SourceControl.BranchesViewViewModel;Refreshing view;
2017-02-17 18:13:46.6961;DEBUG-2.0.12.26410;Rubberduck.Parsing.VBA.RubberduckParserState;Component 'UserForm1' was removed.;
2017-02-17 18:13:46.7431;DEBUG-2.0.12.26410;Rubberduck.Parsing.VBA.ParseCoordinator;Parsing run started. (thread 10).;
2017-02-17 18:13:46.7611;DEBUG-2.0.12.26410;Rubberduck.Parsing.VBA.RubberduckParserState;Component 'UserForm1' was removed.;
2017-02-17 18:13:46.8692;TRACE-2.0.12.26410;Rubberduck.UI.SourceControl.SourceControlViewViewModel;Displaying Error with title 'Unknown exception.' and message 'Document-type component UserForm1 does not exist. Cannot import code from repository.
Document-type component UserForm1 does not exist. Cannot import code from repository.';
2017-02-17 18:13:46.8972;TRACE-2.0.12.26410;Rubberduck.UI.SourceControl.UnsyncedCommitsViewViewModel;Provider changed;
2017-02-17 18:13:46.9242;TRACE-2.0.12.26410;Rubberduck.UI.SourceControl.UnsyncedCommitsViewViewModel;Refreshing view;
2017-02-17 18:13:47.1192;DEBUG-2.0.12.26410;Rubberduck.Parsing.VBA.ParseCoordinator;Parsing run got canceled. (thread 10).;

Note:

  • Form apparently gets removed twice
  • Removing the form component triggers a parse task

@retailcoder retailcoder removed the critical Marks a bug as a must-fix, showstopper issue label Feb 17, 2017
@retailcoder
Copy link
Member

Also UserForm1.log:

Line 8: Property OleObjectBlob in UserForm1 had an invalid file reference.

The error happens because there is no code in the userform module; you can clean up your test repository by following these steps:

  • Delete the folder you selected to create the repository in
  • Edit the SourceControl.rubberduck configuration file under %appdata%\Rubberduck and remove the <Repository> tag for the test project.

Now add another UserForm with some code:

Option Explicit

Sub DoSomething()
End Sub

Should do it. Even Option Explicit alone should be enough. Just as long as there's something in the code-behind.

You can now initialize the repository without any errors.

This is a bug indeed.

@retailcoder retailcoder changed the title Source-control gives error and removes userform from project Source-control gives error and removes userform from project when there's no content Feb 18, 2017
@fitzcee
Copy link
Author

fitzcee commented Feb 18, 2017

Sorry. Still doesn't work for me. I did eventually get it to init with userform1. Don't remember exactly how as I tried very many things. I think I created, let rb delete, then recreated, then initialized. Anyway, it stuck for one round of shutdown, startup, reload. But it deleted when I clicked the sync button in source control pane. Thereafter, it's steady delete -- Create Userform, Sync, Userform gone. Creating multiple forms and all get deleted at sync. frm files are in repository though. I did have code-behind in each.

@dannyandersen
Copy link

dannyandersen commented Apr 30, 2017

I had the same issue. Initializing the repository on C:\SomeDir instead of the network drive solved the issue for me.

EDIT:
Problem was not solved after all and I started getting this strange ID in SourceControl.rubberduck:

<Repository>
  <Id>㐱ㄳ㔰ㄲ</Id>
  <LocalLocation>C:\SomeDir\VBAProject</LocalLocation>
  <RemoteLocation>C:\SomeDir\VBAProject</RemoteLocation>
</Repository>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies work items for known bugs feature-source-control
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants