The following works fine for me:
Sub ExcelStuff()
Dim objExcel As Object
Dim objWorkbook As Object
Dim strFile As String
strFile = "C:\Folder\File.xls"
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.workbooks.Open(strFile)
objWorkbook.Sheets("Sheet1").Copy Before:=objWorkbook.Sheets(1)
objWorkbook.Close SaveChanges:=True
Set objWorkbook = Nothing
objExcel.Application.Quit
Set objExcel = Nothing
End Sub
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Alek Luchnikov" <alekluch---FORSPAMERS---(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello, All!
> I want to copy and rename excel sheet from ÁÓÓÅss vba.
>
> I try this but result is error:
>
> Sht.ActiveWorkbook.WorkSheets("Sheet2").Copy
> Before:=Sheet.ActiveWorkbook.WorkSheets(1)
> or
> Sht.WorkSheets("Sheet1").Copy Before:=Sheet.WorkSheets(1)
>
> I know how to add sheet, insert data from access into sheet & else.
> My searching in internet return nothing.
> Is anybody know how do this ????
> Thank you in advance.
>
> With best regards, Alek Luchnikov.
> E-mail: alekluch---FORSPAMERS---(E-Mail Removed) REMOVE ---FORSPAMERS---
>
>
>