Excel Paste from VBA
Posted on 2003-02-20
I am actually writing a small Visual FoxPro program to automate activities in Excel. Using COM I have created an Excel object in my FoxPro program.
loExcel = createobject('Excel.Application')
The following code then shows Excel and adds a workbook.
loExcel.visible = .t.
The loExcel object acts as an Excel Application in that you can programmatically reference properties and execute commands such as show,add or any Excel function.
What I want to now do is to paste the current contents of the clipboard into the Excel WorkBook, select and copy this range, move down one row and PasteSpecial. I have tried things like:
but I am not really familiar with the correct VBA syntax required.
Does anyone know how I can do the tasks described programatically?