Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Still need some help with nested macro.
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Still need some help with nested macro.
Try this:
Application.Run Range("NEURLYST.XLM!MacroResetWeights") SendKeys "{ENTER}", True SendKeys "{ENTER}", True Let us know if that works Mike F wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Still need some help with nested macro.
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pilgrim needs help: Effecting keystroks required by a macro nested within a macro. | Excel Programming | |||
Function Macro for Nested IF | Excel Worksheet Functions | |||
Nested Subtotal and Macro | Excel Programming | |||
Nested IF absolute referencing macro | Excel Programming | |||
Nested Looping with Tests, Row Copying Macro | Excel Programming |