Hello everybody,
i am new to vba, so please be patient.
maybe you can help me. i want to open an excel sheet, select a cell (maybe "D2" and copy its value/content. then i want to return to word and paste this value/content.
my vba-script does only work until the value/content of the "D2" should be copied to the clipboard. Also it does not return to word and hangs up!
Sub WrdXl()
Dim ExcApp As Object
Set ExcApp = CreateObject("Excel.Application"
ExcApp.Visible = True
ExcApp.Workbooks.Open "C:\sheet1.xls"
ExcApp.Range("D2".Select
Selection.Copy
Set ExcApp = Nothing
Application.ActiveDocument.Activate
Selection.Paste
End Sub
Thanks in Advance,
Greetings from Germany,
Sebastian
i am new to vba, so please be patient.
maybe you can help me. i want to open an excel sheet, select a cell (maybe "D2" and copy its value/content. then i want to return to word and paste this value/content.
my vba-script does only work until the value/content of the "D2" should be copied to the clipboard. Also it does not return to word and hangs up!
Sub WrdXl()
Dim ExcApp As Object
Set ExcApp = CreateObject("Excel.Application"
ExcApp.Visible = True
ExcApp.Workbooks.Open "C:\sheet1.xls"
ExcApp.Range("D2".Select
Selection.Copy
Set ExcApp = Nothing
Application.ActiveDocument.Activate
Selection.Paste
End Sub
Thanks in Advance,
Greetings from Germany,
Sebastian