Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.access.forms,microsoft.public.access.modulesdaovba,microsoft.public.excel.programming,microsoft.public.office.developer.vba
|
|||
|
|||
![]()
I am genrating various Excel worksheet in workbook using MS-Access. I am able to generate worksheet and with the different name. My problem is that when ever I create workbook, 1/3 worksheet automatically appears. I dont want this (sheet1, sheet2, sheet3). I want only my generated worksheet. FOllowing is my coding for adding
*----------------------------------------------- Dim ExcelApp As New Excel.Application Dim ExcelSht As New Excel.Worksheet Dim ExcelWkb As New Excel.Workbook Set ExcelApp = CreateObject("Excel.Application") ExcelApp.Visible = True Set ExcelWkb = ExcelApp.Workbooks.Add ----------Loop Start Set ExcelSht = ExcelWkb.Worksheets.Add ExcelSht.Visible = xlSheetVisible ExcelSht.Move after:=Worksheets(Worksheets.Count) ExcelSht.name = arrCount(name) ExcelSht.PageSetup.PrintGridlines = True ExcelSht.PageSetup.Orientation = xlPortrait .. .. .. .. --- Loop End *-------------------------- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.601 / Virus Database: 382 - Release Date: 02/29/2004 |
#2
![]()
Posted to microsoft.public.access.forms,microsoft.public.access.modulesdaovba,microsoft.public.excel.programming,microsoft.public.office.developer.vba
|
|||
|
|||
![]() |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tools/Options/General
sheets in new workbook =0 |
#4
![]()
Posted to microsoft.public.access.forms,microsoft.public.access.modulesdaovba,microsoft.public.excel.programming,microsoft.public.office.developer.vba
|
|||
|
|||
![]()
Choose from these two options
1: ' To remove all empty sheets ExcelApp.DisplayAlerts = False For Each ExcelSht In ExcelWkb ' An ampty sheet has 1 used cell: "A1" If ExcelSht.UsedRange.Cells.Count = 1 Then ' if this is empty then the sheet is empty If IsEmpty(ExcelSht.UsedRange.Cells(1)) Then ExcelSht.Delete End If End If Next ExcelApp.DisplayAlerts = True 2: ' To remove all default sheets Dim intSheets As Integer ' intSheets = ExcelApp.SheetsInNewWorkbook ExcelApp.DisplayAlerts = False Do While intSheets 0 ExcelWkb.Worksheets("Sheet" & CStr(intSheets)).Delete intSheets = intSheets - 1 Loop ExcelApp.DisplayAlerts = True Good Luck "Ashish Kanoongo" wrote in message ... Onemore thing can I make sheetname tab colorful? "Ashish Kanoongo" wrote in message ... I am genrating various Excel worksheet in workbook using MS-Access. I am able to generate worksheet and with the different name. My problem is that when ever I create workbook, 1/3 worksheet automatically appears. I dont want this (sheet1, sheet2, sheet3). I want only my generated worksheet. FOllowing is my coding for adding *----------------------------------------------- Dim ExcelApp As New Excel.Application Dim ExcelSht As New Excel.Worksheet Dim ExcelWkb As New Excel.Workbook Set ExcelApp = CreateObject("Excel.Application") ExcelApp.Visible = True Set ExcelWkb = ExcelApp.Workbooks.Add ----------Loop Start Set ExcelSht = ExcelWkb.Worksheets.Add ExcelSht.Visible = xlSheetVisible ExcelSht.Move after:=Worksheets(Worksheets.Count) ExcelSht.name = arrCount(name) ExcelSht.PageSetup.PrintGridlines = True ExcelSht.PageSetup.Orientation = xlPortrait . . . . --- Loop End *-------------------------- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.601 / Virus Database: 382 - Release Date: 02/29/2004 -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
remove default data path for sql queries excel 2003? | Setting up and Configuration of Excel | |||
Remove default page breaks | Excel Discussion (Misc queries) | |||
how do i remove default holiday format in XL i.e sat and sun? | Excel Worksheet Functions | |||
how do u remove default setting? | Excel Worksheet Functions | |||
Remove default formating and extra data | Excel Programming |