Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Type Mismatch

Hi Experts

This code keeps coming up with the error 'Mismatch' on
line: Windows(outfile).Activate

Does anyone know why?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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?






Reply
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
Type mismatch... George[_4_] Excel Discussion (Misc queries) 7 December 19th 07 12:20 PM
Type Mismatch [email protected] Excel Worksheet Functions 1 May 16th 07 03:29 PM
type mismatch--how to fix rroach Excel Discussion (Misc queries) 2 July 14th 05 06:23 PM
Type Mismatch Phil Hageman[_3_] Excel Programming 2 January 9th 04 06:11 PM


All times are GMT +1. The time now is 12:28 PM.

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"