Type mismatch

  • Thread starter Thread starter Stuart
  • Start date Start date
S

Stuart

Dimmer than usual this evening.......what am I missing:

Workbooks(wb).SaveAs "C:\BofQProject\QSBofQ _
\Projects\" & SaveDir & "\" & fName & ".xls"

where wb = NewQSBofQ.xls
SaveDir = TEST 910
fName = DUPES

Regards.
 
Try:

Workbooks(wb).SaveAs "C:\BofQProject\QSBofQ" & _
"\Projects\" & SaveDir & "\" & fName & ".xls"

(you can't break a string onto a new line using " _")
 
Thanks, but I broke the line simply for the purposes of
the post. In the module, it occupies one line.

Regards.
 
Are wb, SaveDir and fName all string variables?

If wb is a workbook object variable it will give a Type mismatch. In
that case, the call should be

wb.SaveAs ...

Otherwise, I can't tell from the info you've presented.
 
Many thanks.....you got it.

wb.SaveAs, since wb was an object variable.

Regards and thanks.
 
Back
Top