G Guest Mar 28, 2007 #1 As well as specifying the file name is it possible to specify the sheet as well?
A Ashfaque Joined Mar 28, 2007 Messages 1 Reaction score 0 Mar 28, 2007 #2 Here is the code how to mention the sheet name while transfering data to Excel. Dim objXL As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Dim rst As Recordset Dim iRow As Integer '--- open the workbook Set objXL = New Excel.Application objXL.Visible = True Set objWkb = objXL.Workbooks.Open("D:\MyProjects\MaterialList.xls") 'Here to mention the sheet name Set objSht = objWkb.Worksheets("Sheet1") ' Further code lines.. Hope this helps Ashfaque Last edited: Mar 28, 2007
Here is the code how to mention the sheet name while transfering data to Excel. Dim objXL As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Dim rst As Recordset Dim iRow As Integer '--- open the workbook Set objXL = New Excel.Application objXL.Visible = True Set objWkb = objXL.Workbooks.Open("D:\MyProjects\MaterialList.xls") 'Here to mention the sheet name Set objSht = objWkb.Worksheets("Sheet1") ' Further code lines.. Hope this helps Ashfaque
K Ken Snell \(MVP\) Mar 28, 2007 #3 See the info at this website: http://alexdyb.blogspot.com/2006/07/export-to-excel-range.html
G Guest Mar 28, 2007 #4 Cheers Ken Snell (MVP) said: See the info at this website: http://alexdyb.blogspot.com/2006/07/export-to-excel-range.html Click to expand...
Cheers Ken Snell (MVP) said: See the info at this website: http://alexdyb.blogspot.com/2006/07/export-to-excel-range.html Click to expand...