Hi,
I've got problems with this simple piece of code.
I try to automate CD burning with executing Nero burning
software, than sending some kestrokes to it in order to
erase the CDRW, than burn the new backup files and finally
exit the application.
It opens the Nero application, but after that I get:
Run-time error '5':
Invalid procedure call or argument
The platform is Win2000 Professional (same happens on
Win2000 Server).
The form is also very simple - one textbox for entering the
description of the backup (label for CD) and one command
button (Command1) for which the code is shown below:
Private Sub Command1_Click()
Dim dRate As Double
Dim curPayment As Currency, curLoan As Currency
Dim iYears As Integer
Dim rtrn
Screen.MousePointer = vbHourglass
rtrn = Shell("C:\Program Files\ahead\Nero\nero.exe", 1) ' Run Nero.
AppActivate rtrn, True ' activate Nero.
SendKeys "{~}{~}{~}{~}", True ' type some keys in wizard
SendKeys "{%}rw{~}", True ' RW erase
SendKeys "{F2}" & Me.Glavnica & "{~}{^}{TAB}{^}a{^}c{^}{TAB}{^}v{%}fw{~}", True ' Burn the CD
SendKeys "{~}d{%}fxn", True ' end of Nero.
Screen.MousePointer = vbDefault
End Sub
Maybe there are other ways to automate the kestrokes in an
applications ...
Help!
George
I've got problems with this simple piece of code.
I try to automate CD burning with executing Nero burning
software, than sending some kestrokes to it in order to
erase the CDRW, than burn the new backup files and finally
exit the application.
It opens the Nero application, but after that I get:
Run-time error '5':
Invalid procedure call or argument
The platform is Win2000 Professional (same happens on
Win2000 Server).
The form is also very simple - one textbox for entering the
description of the backup (label for CD) and one command
button (Command1) for which the code is shown below:
Private Sub Command1_Click()
Dim dRate As Double
Dim curPayment As Currency, curLoan As Currency
Dim iYears As Integer
Dim rtrn
Screen.MousePointer = vbHourglass
rtrn = Shell("C:\Program Files\ahead\Nero\nero.exe", 1) ' Run Nero.
AppActivate rtrn, True ' activate Nero.
SendKeys "{~}{~}{~}{~}", True ' type some keys in wizard
SendKeys "{%}rw{~}", True ' RW erase
SendKeys "{F2}" & Me.Glavnica & "{~}{^}{TAB}{^}a{^}c{^}{TAB}{^}v{%}fw{~}", True ' Burn the CD
SendKeys "{~}d{%}fxn", True ' end of Nero.
Screen.MousePointer = vbDefault
End Sub
Maybe there are other ways to automate the kestrokes in an
applications ...
Help!
George