Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, I can't get the following code to execute correctly. It creates a new
worksheet, but not from a template as I intended. Can anyone help? Sub CTMacro() On Error Resume Next Dim ExcelSheet As Object Application.DisplayAlerts = False Set ExcelSheet = CreateObject("Excel.Sheet") Set ExcelSheet = ExcelSheet.Workbooks.Add("C:\CTest.xlt") With Workbooks("Copy of ApptDis.xls") .Worksheets("Sheet1").Range("B2:I2").Copy ExcelSheet.Application.Visible = True With ExcelSheet.ActiveSheet.Range("B2:I2") .PasteSpecial xlPasteValues ExcelSheet.SaveAs "C:\CTest.xls" Application.DisplayAlerts = True End With End With End Sub Thanks in advance for any help. Paul |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with CreateObject | Excel Programming | |||
Createobject for FTP | Excel Programming | |||
VBA - createobject - If | Excel Programming | |||
CREATEOBJECT Using VB | Excel Programming | |||
Difference between NEW and CREATEOBJECT? | Excel Programming |