|
-
May 2nd, 2007, 02:32 AM
#1
Thread Starter
Junior Member
[RESOLVED] closing excel file
hi all, i am opening an excel file for some updation, but after my completion of updation. i am prompting for Save changes in that file while i am closing that excel application.
eg:
xl.Workbooks.Open(fp) 'fp-filename
--------
--------
doing updation here
---------
---------
xl.ActiveWorkbook.Save
xl.ActiveWorkbook.Close ' while exceuting this line only i am
promting for "Save Changes in the
file"
i have to close this excel file without any prompting same time i have to save the updations done in that file...plz help me to resolve this problem
thanks in advance
-
May 2nd, 2007, 02:44 AM
#2
Fanatic Member
Re: closing excel file
Use: xl.ActiveWorkbook.SaveAs "Filename"
(Note that this is free-hand coding, it could contain errors, but it should help you on the way)
- Use the thread tools to Mark your Thread as Resolved when your question is answered.
- Please Rate my answers if they where helpful.
-
May 2nd, 2007, 03:13 AM
#3
Thread Starter
Junior Member
Re: closing excel file
thanks for ur reply yar. i can use the SaveAs option..
if i use xl.ActiveDocument.SaveAs "FileName", then it is promting for File Replace.... it is saying that the "folder contain another file with the same file, click Yes to replace it", so i have to Confirm File Replacement with the xl.ActiveDocument.SaveAs option itself...
Is there any option for file replacement while using SaveAs option.
-
May 2nd, 2007, 03:25 AM
#4
Fanatic Member
Re: closing excel file
- If you want to save the existing file as itself , just use save.
- If your excel file is not saved yet, or you want it to save as another filename. Check if the filename wich you want to save allready exists, if so delete the file and then use SaveAs.
- Use the thread tools to Mark your Thread as Resolved when your question is answered.
- Please Rate my answers if they where helpful.
-
May 2nd, 2007, 03:31 AM
#5
Thread Starter
Junior Member
Re: closing excel file
i want to save the existing file only... for this i am using:
xl.ActiveWorkBook.Save
xl.ActiveWorkBook.Close fp 'fp-filename
but, i am prompting an window "Do you want to save the changes you made to file ?"
i should not display this window, instead it has to automatically save the changes
-
May 2nd, 2007, 03:37 AM
#6
Fanatic Member
Re: closing excel file
vb Code:
xl.ActiveWorkBook.Close True, "FileName.xls"
From the excel help:
expression.Close(SaveChanges, FileName, RouteWorkbook)
SaveChanges = True, changes are saved to the filename specified
SaveChanges = False, changes are not saved
SaveChanges = Not filled in, The user is prompted with the question.
- Use the thread tools to Mark your Thread as Resolved when your question is answered.
- Please Rate my answers if they where helpful.
-
May 2nd, 2007, 04:25 AM
#7
Thread Starter
Junior Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|