Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi my post must not have gone through last night....
I finally go things to work... Here is a simplified version: Sub MyRoutine() Dim wsh As Object Dim fs As Object Dim DesktopPath As String Dim fname As String Dim fStr As String Dim arr As Variant Dim wb As Workbook Redim arr(1) 'arr represents my array of file names arr(1) = "mynewfile.xls" Set wsh = CreateObject("WScript.Shell") Set fs = CreateObject("Scripting.FileSystemObject") DesktopPath = wsh.SpecialFolders.Item("Desktop") DirString = DesktopPath & "\MyNewFolder" fstr = arr(1) fname = DirString & "\" & fstr Workbooks.add Set wb = ActiveWorkbook wb.SaveAs(fstr) Workbooks("Myfirstworkbook.xls").Worksheets("mycop ysheet").Copy _ After:=Workbooks(fstr).Sheets(1) .. .. .. .. End Sub Thanks for your help. It might have been the .Close False although I thought that meant that it shouldn't close it, maybe it means don't ask something? or it could have been the xlWBATWorksheet that someone else gave me. Doesn't seem needed anyway. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying Worksheet to Another Open Workbook | Excel Programming | |||
Copying Worksheet to Another Open Workbook | Excel Programming | |||
Copying Worksheet to Another Open Workbook | Excel Programming | |||
Copying Worksheet to Another Open Workbook | Excel Programming | |||
Copying Worksheet to Another Open Workbook | Excel Programming |