LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 183
Default error "Set wb = Workbooks(FilePathName)"

I'm sorry, wasn't sure how to catagorize this in the subject line.........
I'm trying to copy tabs from a non-active workbook and paste them to an
active workbook, however I must be doing this all wrong.
Can anyone help me? Thanks.




Dim FilePathName As String
FilePathName = "Q:\Finance\Forecast\2007\" & TimePeriod & "\Cons Fin\" &
strName & ".xls"

'clears/resets objects for finding latest modified file
Set oFSO = Nothing
Set oFile = Nothing
Set oFolder = Nothing


' copy ConsFin Tabs to Tri Interest & Interco Report
Dim wb As Workbook
Set wb = Workbooks(FilePathName)
wb.Sheets(5).Copy ActiveWorkbook.Sheets("TRI - Dec Int Inc")
wb.Sheets(7).Copy ActiveWorkbook.Sheets("TRI - Int Abov EBITDA")
wb.Close True
Set wb = Nothing
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking workbooks; experiencing random "#n/a" error martin Excel Discussion (Misc queries) 0 May 10th 10 04:58 PM
Multiple "source" workbooks linked to single "destination" workboo DAVEJAY Excel Worksheet Functions 1 September 17th 07 05:33 PM
What is Error "Method "Paste" of object "_Worksheet" failed? vat Excel Programming 7 February 17th 06 08:05 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
"Subscript out of range" error for: Workbooks("Test1.xls").Save Just12341234 Excel Programming 2 June 17th 05 03:16 PM


All times are GMT +1. The time now is 05:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"