Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm not sure I'm doing this right. I used this to open the other workbook in another procedure and it worked fine. Now I'm getting an out of range message. Also, am I identifying the two different workbook correctly in determining the LusedRow? Dim wbkCopyFrom As Workbook Set wbkCopyFrom = Workbooks("C:\Documents and Settings\Eileen\Desktop\New Workbooks\test.xls") If wbkCopyFrom Is Nothing Then Set wbkCopyFrom = Workbooks.Open("C:\Documents and Settings\Eileen\Desktop\New Workbooks\test.xls") On Error GoTo Done If wbkCopyFrom Is Nothing Then MsgBox "Cannot find originating file" Else Set ws = wbkCopyFrom.Sheets(Replace(MainPagepg.Name, "'", "''")) Application.ScreenUpdating = False 'get the last tenant's row in the From workbook FromLusedRow = ws.Cells(Rows.Count, "F").End(xlUp).Row 'get the last tenant's row in the New workbook NewLusedRow = MainPagepg.Cells(Rows.Count, "F").End(xlUp).Row -- Thanks for your help. Karen53 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA Excel.WorkBooks.Open can't open an XML format xls file | Excel Programming | |||
When I open Excel, workbooks open automatically. How can I stop t | Excel Discussion (Misc queries) | |||
workbooks.open function fails to open an existing excel file when used in ASP, but works in VB. | Excel Programming | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming | |||
Workbooks.Open / .Open Text - How do you stop the .xls addition? | Excel Programming |