![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Anyway to add worksheets on loop Set rsTemp = server.createobject("adodb.recordset") conn.Webqry_SelectList rsTemp do while not rstemp.eof Add worksheet here loop |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Anyway to add worksheets on loop On Oct 14, 11:33*am, RICK <R...@xxxxxx> wrote: Quote: > Set rsTemp = server.createobject("adodb.recordset") > conn.Webqry_SelectList rsTemp > do while not rstemp.eof > > Add worksheet here > > loop ' Watch for word wrap! Dim XL Dim WB ' First create the Excel workbook Set XL = GetObject(, "Excel.Application") If Err.Number <> 0 Then Set XL = CreateObject("Excel.Application") End If Set WB = XL.Workbooks.Add Set XL = GetObject(, "Excel.Application") If Err.Number <> 0 Then Set XL = CreateObject("Excel.Application") End If ' Add a workbook to the Excel File Set WB = XL.Workbooks.Add 'Do your stuff to create your connection and recordsets Set rsTemp = server.createobject("adodb.recordset") conn.Webqry_SelectList rsTemp do while not rstemp.eof 'Add the worksheet to the workbook WB.Worksheets.Add.Move after:=WB.Worksheets(WB.Worksheets.Count) loop |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| RE: How to do something in an VBS script for all worksheets of an Exce | VB Script | |||
| Re: How to do something in an VBS script for all worksheets of an Excel file? | VB Script | |||
| RE: How to do something in an VBS script for all worksheets of an Exce | VB Script | |||
| Excel 2007/ Vista- Problem Duplicating Worksheets Within Same Work | Vista General | |||
| Accept terms & conditions message for Excel worksheets | Vista General | |||