12-11-2009, 11:07 AM
If you can tell us how you are connecting to excel, that will be helpful for us to help you.
Paste your lines of code.
I guess you are using ADODB to connect to excel , if so try the code below
Paste your lines of code.
I guess you are using ADODB to connect to excel , if so try the code below
Code:
Dim cn
Set cn = CreateObject("ADODB.Connection")
cn.Open "Driver={Microsoft Excel Driver (*.xls)};DBQ=D:\My QTP\ExcelADO\Test.xls; ReadOnly=False;"
Set rs = cn.Execute ("update [sheet1$] set USER_NAME = 'niss1234' where KEY = 'LOG2'")
Set rs = cn.Execute ("select * from [sheet1$] where KEY = 'LOG2'")
msgbox rs.Fields("USER_NAME").Value