Populating Excel Cell using Cell Name instead of Cell Row and Column

  • I have following code

    execute @rs = dbo.sp_OACreate 'Excel.Application', @xlApp OUTPUT

    execute @rs = master.dbo.sp_OAMethod @xlApp, 'Workbooks', @xlWorkbooks OUTpUT

    --execute @rs = master.dbo.sp_OAMethod @xlWorkBooks, 'Add', @xlWorkBook OUTPUT, -4167

    execute @rs = master.dbo.sp_OAMethod @xlWorkbooks, 'Open', @xlWorkBook OUTPUT, @FileName

    execute @rs = master.dbo.sp_OAMethod @xlWorkBook, 'ActiveSheet', @xlWorkSheet OUTPUT

    -- KO#

    execute master.dbo.sp_OAGetProperty @xlWorkSheet, 'Cells', @xlCell OUTPUT, 4, 3

    execute @rs = master.dbo.sp_OASetProperty @xlCell, 'Value', @co

    Above code put data in Excel Row 4 Column 3

    I would like to change it to access by name somthing like this

    execute master.dbo.sp_OAGetProperty @xlWorkSheet, 'Cells', @xlCell OUTPUT, 'OrderNumber'

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply