![]() |
Type Mismatch
Hi Experts
This code keeps coming up with the error 'Mismatch' on line: Windows(outfile).Activate Does anyone know why? |
Type Mismatch
Sorry forgot code....!!!!
Sub Create_Remittance() For i = 4 To Sheets.Count Set sh = Sheets(i) sh.Activate File_Name = ActiveWorkbook.Worksheets("Menu").Cells.Range ("D9").Value Set outfile = Workbooks.Open(File_Name) Windows("Remittance Module.xls").Activate Range("B1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B6") Range("C1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B8") Range("F1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B10") Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("A16") Range("D1:D" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("B16") Range("G1:G" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("C16") Range("H1:H" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("D16") Windows(outfile).Activate Supp_Name = Range("B8") Trans_No = Range("B10") Trans_Date = Range("B6") ActiveWorkbook.SaveAs ("C:\Documents and Settings\ThoemmE1 \Desktop\Remittance Project\Remittance\" & Supp_Name & " " & Trans_No & " " & Trans_Date & ".xls") ActiveWorkbook.Close Next i ActiveWorkbook.Sheets("Menu").Select End Sub |
Type Mismatch
Windows(outfile.name).Activate
-- Regards, Tom Ogilvy "Edgar" wrote in message ... Hi Experts This code keeps coming up with the error 'Mismatch' on line: Windows(outfile).Activate Does anyone know why? |
Type Mismatch
or
Outfile.Activate -- Regards, Tom Ogilvy "Edgar" wrote in message ... Hi Experts This code keeps coming up with the error 'Mismatch' on line: Windows(outfile).Activate Does anyone know why? |
Type Mismatch
Answer would be the same
outfile.activate or Windows(outfile.name).Activate -- Regards, Tom Ogilvy "Edgar" wrote in message ... Sorry forgot code....!!!! Sub Create_Remittance() For i = 4 To Sheets.Count Set sh = Sheets(i) sh.Activate File_Name = ActiveWorkbook.Worksheets("Menu").Cells.Range ("D9").Value Set outfile = Workbooks.Open(File_Name) Windows("Remittance Module.xls").Activate Range("B1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B6") Range("C1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B8") Range("F1").Copy Destination:=outfile.Worksheets ("Remittance").Range("B10") Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("A16") Range("D1:D" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("B16") Range("G1:G" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("C16") Range("H1:H" & Cells(Rows.Count, 1).End(xlUp).Row).Copy Destination:=outfile.Worksheets("Remittance").Rang e("D16") Windows(outfile).Activate Supp_Name = Range("B8") Trans_No = Range("B10") Trans_Date = Range("B6") ActiveWorkbook.SaveAs ("C:\Documents and Settings\ThoemmE1 \Desktop\Remittance Project\Remittance\" & Supp_Name & " " & Trans_No & " " & Trans_Date & ".xls") ActiveWorkbook.Close Next i ActiveWorkbook.Sheets("Menu").Select End Sub |
All times are GMT +1. The time now is 02:05 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com