Skip to content

Commit 1009854

Browse files
committed
documented why FallbackApp can't work :'(
1 parent a7b1ac4 commit 1009854

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Rubberduck.VBEEditor/Extensions/VbeExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static IHostApplication HostApplication(this VBE vbe)
6767
switch (host_app_control.Caption)
6868
{
6969
case "Microsoft Excel":
70-
/*return new FallbackApp(vbe);//*/return new ExcelApp();
70+
return new ExcelApp();
7171
case "Microsoft Access":
7272
return new AccessApp();
7373
case "Microsoft Word":
@@ -84,7 +84,7 @@ public static IHostApplication HostApplication(this VBE vbe)
8484
return new CorelDRAWApp();
8585
}
8686
}
87-
return null; //new FallbackApp(vbe);
87+
return null;// new FallbackApp(vbe);
8888
}
8989

9090
foreach (var reference in vbe.ActiveVBProject.References.Cast<Reference>()
@@ -93,7 +93,7 @@ public static IHostApplication HostApplication(this VBE vbe)
9393
switch (reference.Name)
9494
{
9595
case "Excel":
96-
/*return new FallbackApp(vbe);//*/return new ExcelApp(vbe);
96+
return new ExcelApp(vbe);
9797
case "Access":
9898
return new AccessApp();
9999
case "Word":

Rubberduck.VBEEditor/VBEHost/FallbackApp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class FallbackApp : IHostApplication
1212
private readonly CommandBarButton _runButton;
1313

1414
private const int DebugCommandBarId = 4;
15-
private const int RunMacroCommand = 5415;
15+
private const int RunMacroCommand = 186;
1616

1717
public FallbackApp(VBE vbe)
1818
{
@@ -23,14 +23,14 @@ public FallbackApp(VBE vbe)
2323

2424
public void Run(QualifiedMemberName qualifiedMemberName)
2525
{
26-
2726
var component = qualifiedMemberName.QualifiedModuleName.Component;
2827
var line = component.CodeModule.get_ProcBodyLine(qualifiedMemberName.MemberName, vbext_ProcKind.vbext_pk_Proc);
2928

3029
component.CodeModule.CodePane.SetSelection(line, 1, line, 1);
3130
component.CodeModule.CodePane.ForceFocus();
3231

3332
_runButton.Execute();
33+
// note: this can't work... because the .Execute() call isn't blocking, so method returns before test method actually runs.
3434
}
3535

3636
public TimeSpan TimedMethodCall(QualifiedMemberName qualifiedMemberName)

0 commit comments

Comments
 (0)