Using Jim's code, you would say
xlApp.ActiveWorkBook.SaveAs(" ")
or
.ActiveWorkBook.SaveAs(" ")
if it's inside the With xlApp block.
(I presume there's actually a file name in the " ")
You might also want to put
.Application.DisplayAlerts = False
and
.Application.DisplayAlerts = True
around the SaveAs line to prevent a prompt if the file already exists
(or you could handle this possibility another way, e.g. by checking
whether it exists before trying to save)
Andrew
Suraj wrote:
> Thanks Jim. I got the logic. I have one more query.
>
> Using the VBA I want to save an Excel file which is already opened. I
> tried to do this by ActiveWorkBook.SaveAs(" ").
> But not working.
> Please let me know the correct way of doing that or correct way of
> using the above command.
>
> Thanks,
> Suraj
Bookmarks