Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I opened a new session of excel and kept the personal macro file unhidden. Then I opened a new worksheet book1. In VB I inserted a module in Book 1. Then I wrote this code. Surprsingly, excel saved book 1 in my Xlstart folder along with the personal macro workbook. ( I had not saved Book 1) Sub closingexcel() Application.DisplayAlerts = False Application.Quit Workbooks("book1").Save Workbooks("personal").Save End Sub Regards, Hari India |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
you should try to first save the files and the quit the application. Also Excel saves the file in the current directory. So you may change the directory first in your macro -- Regards Frank Kabel Frankfurt, Germany Hari wrote: Hi, I opened a new session of excel and kept the personal macro file unhidden. Then I opened a new worksheet book1. In VB I inserted a module in Book 1. Then I wrote this code. Surprsingly, excel saved book 1 in my Xlstart folder along with the personal macro workbook. ( I had not saved Book 1) Sub closingexcel() Application.DisplayAlerts = False Application.Quit Workbooks("book1").Save Workbooks("personal").Save End Sub Regards, Hari India |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Frank,
I was doing a test to understand whether excel saves the files if I write application.quit before writing the save workbooks statements. I was surprised that excel continues to exceute statement even after it encounters quit statement. ( That is it saved my Book 1). I still dont understand this aspect completely. Also, I was surprised that Excel saved my book1 which was a new workbook and usually if we press on save button on new workbooks it prompts for the location ( and the default location is My Documents for my excel 2002) so I expected excel to save the file in My documents if at all the file is saved. Rather excel saved it in xlstart folder. U say that I shud change the directory. But, how is it that when Im working on a completely new excel session with no other macros run in it the VB remembers or considers the default location to be xlstart folder. Please elaborate if possible. Regards, Hari India "Frank Kabel" wrote in message ... Hi you should try to first save the files and the quit the application. Also Excel saves the file in the current directory. So you may change the directory first in your macro -- Regards Frank Kabel Frankfurt, Germany Hari wrote: Hi, I opened a new session of excel and kept the personal macro file unhidden. Then I opened a new worksheet book1. In VB I inserted a module in Book 1. Then I wrote this code. Surprsingly, excel saved book 1 in my Xlstart folder along with the personal macro workbook. ( I had not saved Book 1) Sub closingexcel() Application.DisplayAlerts = False Application.Quit Workbooks("book1").Save Workbooks("personal").Save End Sub Regards, Hari India |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Closing workbooks w/o closing Excel | Excel Discussion (Misc queries) | |||
Saving and Closing | Excel Discussion (Misc queries) | |||
Saving when closing excel | Excel Discussion (Misc queries) | |||
close workbooks without closing excel ? | Excel Discussion (Misc queries) | |||
Closing Excel without saving | Excel Discussion (Misc queries) |