No New Workbook Annoyance

S

Stephen

Hello,
I have this problem where after running my macro, Excel no longer
loads a new workbook automatically; the user has to either press Ctrl
+N or go to File->New... It's a minor annoyance, but I was hoping to
have my macro not need the user to do this everytime they open up
Excel. The macro code is shown below:

Sub AutoExec()
Dim file_Check As Object

Set file_Check = CreateObject("Scripting.FileSystemObject")
If file_Check.FileExists(Selection.Application.Path & "\XLSTART
\Excel2Wiki.xls") = False Then
ActiveWorkbook.SaveAs Filename:=Selection.Application.Path &
"\XLSTART\Excel2Wiki.xls", FileFormat:=xlNormal
Call DeleteMenus
Call CreateMenus
ActiveWindow.Visible = False
Application.Quit
End If
End Sub

Before running this, Excel automatically loads a new workbook. After
deleting the *.xls from the XLSTART folder, Excel is restored to
loading a new workbook. However, when the *.xls is in the XLSTART, it
is hidden, but Excel doesn't automatically load a new workbook. If
anybody can explain the cause and/or the solution, that would be
great. Thanks.
 
S

Stephen

Also, if I'm in the wrong group, can someone also please inform me of
this? Thanks.
 
S

Stephen

Sorry for the triple post. I just found the solution to my problem. I
had to rename the *.xls file from "Excel2Wiki" to "Personal". I really
find that unbelievable.

As a programmer, I would think that any file in the XLSTART folder
would behave the same way in order to allow different types of macros
to be stored in different files for organization. Apparently, I was
wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top