Вы можете использовать WSH Scripting Shell для этого:
WshShell shell = new WshShellClass();
object missing=System.Reflection.Missing.Value;
shell.SendKeys("MOO!!!", ref missing);
Все, что вам нужно сделать, это добавить ссылку COM на «Объект Windows Scripting Host Object», версия 1.0. Все находится в пространстве имен IWshRuntimeLibrary
.
Ниже приведены некоторые предложения. Измените и попробуйте:
Option Explicit
Sub Loomisinsert()
With ThisWorkbook.Worksheets("Sheet1")
'Deletes old Data and inserts new
.Range("B2:J1000").Clear
.Range("B5").Copy .Range("B2") '<- Easy way to copy - paste
'Deletes unnecessary data
.Range("K3:N5000,P3:Q5000,S3:U5000").Clear'<- Does not need to use "L3:L5000" because included in "K3:N5000". Additionally, have in mind that *.Delete* may cause problem with columns & rows. It s more preferable to use *.Clear* or *.Clearcontents*. *.Clear* used to clear both formats and value. In the other hand *.Cleatcontents* just empty the cell from value.
End With
End Sub