Write Conent To Excel using ADO connectio
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2019
05:23 AM
09-26-2019
05:23 AM
Write Conent To Excel using ADO connectio
Hi team,
im trying to write some content to excel using ADO connection.
can any one help me in achieving the same.
im using Python and below is the sample code where i m trying to write the content to excel.
def writeDataToExcel(): strSheet = 'over' filepath = r'C:\Users\sathishkumark\Desktop\Test.xlsx' ConnectionString = 'Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ='+filepath+';ReadOnly=0;Extended Properties=Excel 12.0 Macro;HDR=YES;' objExcel = ADO.CreateConnection() objExcel.ConnectionString = ConnectionString objExcel.Open() objRS = ADO.CreateRecordset() strQuery = "update ["+strSheet+"$] set col1 = 'sda';" objRS.Open (strQuery, objExcel, 3, 3) objExcel.Close() objExcel.Close()
Kind Regards,
Sathish Kumar K
Solved! Go to Solution.
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019
04:25 AM
09-27-2019
04:25 AM
Hi @Mr_Bro,
Please refer to the following article - it contains an example in Python:
https://smartbear-cc.force.com/portal/KbArticleViewer?name=Write-data-to-MS-Excel&sp=testcomplete
---------
Tanya Yatskovskaya
SmartBear Community and Education Manager
Tanya Yatskovskaya
SmartBear Community and Education Manager
