Still need some help with nested macro.

B

borsheim

I am using a password protected macro ("PPM") within a macro I am
attempting to write. Unfortunately the PPM has two pop up screens
that require keyboard responses, in this case, simply hitting the
"Enter" key twice. It was previously suggested that I use "SendKeys"
statements, but I haven't been able to get those to work (which is an
admission of my limited ability rather than an impeachment of the
advice).

I have copied my macro below. It runs just fine except that the PPM
"MacroResetWeights" halts everything until I hit the Return key twice.
What can I add to my macro to avoid the manual keyboard entries?

'
For I = 1 To 110
Range("BK10").Select
Range("BK10").Value = I
Range("BK11").Select
Application.Run Range("NEURLYST.XLM!MacroResetWeights")
Application.Run Range("NEURLYST.XLM!MacroTrainNetwork")
Sheets("Training Data").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range("A1:O1").Select
Selection.Copy
Selection.End(xlDown).Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Any Chord").Select
Next I
'
End Sub
 
M

Mike Fogleman

Try this:
Application.Run Range("NEURLYST.XLM!MacroResetWeights")
SendKeys "{ENTER}", True
SendKeys "{ENTER}", True

Let us know if that works
Mike F
 
B

borsheim

I appreciate your help, Mike, but I am afraid the problem remains. I
still get the two prompt screens which I have to satisfy with manual
entries (although I didn't get any of the bizzare run errors generated
by some of the permutations I tried)!

I ran accross a "SendKeys Method" in Excel's VBA Help which places
keystrokes in a key buffer (haven't seen that used in quite a while).
It then goes on to say

In some cases you must call this method before
you call the method that will use the keystrokes.
For example, to send a password to a dialog
box, you must call the SendKeys method before
you display the dialog box.

Intuitively, I am inclined to think "the method" might do the trick,
but at my level of understanding this two sentence explanation has
left me scratching my head.

Thanks,
Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top