Information générale
Catégorie:
Code, syntaxe and commandes
>Using C#.
>
>I need to send these keystrokes to an open excel file. I have searched Google from one end to the other, and I can't seem to find a coherent example.
>
>Can someone show me how to do this?
By 'open excel file' do you mean an instance of Excel that is open on the desktop or an oledb connection?
If the former (and the Excel app has focus) you can use the System.Windows.Forms.SendKeys class:
SendKeys.Send("^S^X")
If it doesn't have focus you might basing a solution on this class (I haven't):http://www.codeproject.com/KB/cs/SendKeys.aspx
HTH,
Viv
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement