Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
JackR
 
Posts: n/a
Default Problem when opening Excel

I downlaoded a VBA script from XL-Logic.com called default_wb.zip. I wanted
to try this to see if it would work for my application. It was a sample on
how to automate the creation of workbooks and sheets. It was not what I
thought. Now every time I open a new workbook or sheet in Excel, this macro
starts and will not give me a blank sheet or workbook. I have copied the
scrip below to see if anyone can figure out how I get rid of this. Please
help, it is driving me crazy. Hee is the text that shows up on the workbook
when I start it, it is on sheet1, it says
"This workbook contains example macros that show how default sheets and
workbooks can be quickly created using VBA. The code allows you to set up
this workbook as you would like all new workbooks (worksheets) to appear.
When you run the macros, the appropriate default workbook/worksheet is saved
in the XLstart directory.".
I went to the XL start directory but there is nothing there. Please help.
Here are the two macros:

Sub WorkbookDefault()
Dim ans As Integer
ans = MsgBox(prompt:="New workbooks will be base on this workbook with
the same page setup, view options... Even the content will be the same." &
Chr(13) & Chr(13) & _
"This procedure can not be undone. Do you want to proceed?" &
Chr(13), Buttons:=vbYesNo)
If ans = vbNo Then End
Application.DisplayAlerts = False
If Application.AltStartupPath < "" And Dir(Application.AltStartupPath,
16) < "" Then
ActiveWorkbook.SaveAs Filename:=Application.AltStartupPath &
"\book.xlt", FileFormat:=xlTemplate
ActiveWindow.Close
End
End If
On Error GoTo 10
ActiveWorkbook.SaveAs Filename:=Application.StartupPath & "\book.xlt",
FileFormat:=xlTemplate
ActiveWindow.Close
End
10: If Application.DefaultFilePath < "" And
Dir(Application.DefaultFilePath, 16) < "" Then
MkDir Application.DefaultFilePath & "\xlstart"
Application.AltStartupPath = Application.DefaultFilePath & "\xlstart"
ActiveWorkbook.SaveAs Filename:=Application.AltStartupPath &
"\book.xlt", FileFormat:=xlTemplate
Else
MkDir "c:\xlstart"
Application.AltStartupPath = "c:\xlstart"
ActiveWorkbook.SaveAs Filename:=Application.AltStartupPath &
"\book.xlt", FileFormat:=xlTemplate
End If
ActiveWindow.Close
End Sub

Sub SheetDefault()
Dim Sh
Dim ans As Integer
ans = MsgBox(prompt:="New sheets will be base on this sheet with the
same page setup, view options... Even the content will be the same." &
Chr(13) & Chr(13) & _
"This procedure can not be undone. Do you want to proceed?" &
Chr(13), Buttons:=vbYesNo)
If ans = vbNo Then End
Application.DisplayAlerts = False
ActiveSheet.Copy
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name < ActiveSheet.Name Then Sh.Delete
Next Sh
ActiveSheet.Name = " "
If Application.AltStartupPath < "" And Dir(Application.AltStartupPath,
16) < "" Then
ActiveSheet.SaveAs Filename:=Application.AltStartupPath &
"\sheet.xlt", FileFormat:=xlTemplate
ActiveWindow.Close
End
End If
On Error GoTo 10
ActiveSheet.SaveAs Filename:=Application.StartupPath & "\sheet.xlt",
FileFormat:=xlTemplate
ActiveWindow.Close
End
10: If Application.DefaultFilePath < "" And
Dir(Application.DefaultFilePath, 16) < "" Then
MkDir Application.DefaultFilePath & "\xlstart"
Application.AltStartupPath = Application.DefaultFilePath & "\xlstart"
ActiveSheet.SaveAs Filename:=Application.AltStartupPath &
"\sheet.xlt", FileFormat:=xlTemplate
Else
MkDir "c:\xlstart"
Application.AltStartupPath = "c:\xlstart"
ActiveSheet.SaveAs Filename:=Application.AltStartupPath &
"\sheet.xlt", FileFormat:=xlTemplate
End If
ActiveWindow.Close
End Sub


Thanks for any input

  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Problem when opening Excel

try
toolsoptionsgeneral"at startup"

--
Don Guillett
SalesAid Software

"JackR" wrote in message
...
I downlaoded a VBA script from XL-Logic.com called default_wb.zip. I wanted
to try this to see if it would work for my application. It was a sample on
how to automate the creation of workbooks and sheets. It was not what I
thought. Now every time I open a new workbook or sheet in Excel, this
macro
starts and will not give me a blank sheet or workbook. I have copied the
scrip below to see if anyone can figure out how I get rid of this. Please
help, it is driving me crazy. Hee is the text that shows up on the
workbook
when I start it, it is on sheet1, it says
"This workbook contains example macros that show how default sheets and
workbooks can be quickly created using VBA. The code allows you to set up
this workbook as you would like all new workbooks (worksheets) to appear.
When you run the macros, the appropriate default workbook/worksheet is
saved
in the XLstart directory.".
I went to the XL start directory but there is nothing there. Please help.
Here are the two macros:

Sub WorkbookDefault()
Dim ans As Integer
ans = MsgBox(prompt:="New workbooks will be base on this workbook with
the same page setup, view options... Even the content will be the same." &
Chr(13) & Chr(13) & _
"This procedure can not be undone. Do you want to proceed?" &
Chr(13), Buttons:=vbYesNo)
If ans = vbNo Then End
Application.DisplayAlerts = False
If Application.AltStartupPath < "" And Dir(Application.AltStartupPath,
16) < "" Then
ActiveWorkbook.SaveAs Filename:=Application.AltStartupPath &
"\book.xlt", FileFormat:=xlTemplate
ActiveWindow.Close
End
End If
On Error GoTo 10
ActiveWorkbook.SaveAs Filename:=Application.StartupPath & "\book.xlt",
FileFormat:=xlTemplate
ActiveWindow.Close
End
10: If Application.DefaultFilePath < "" And
Dir(Application.DefaultFilePath, 16) < "" Then
MkDir Application.DefaultFilePath & "\xlstart"
Application.AltStartupPath = Application.DefaultFilePath &
"\xlstart"
ActiveWorkbook.SaveAs Filename:=Application.AltStartupPath &
"\book.xlt", FileFormat:=xlTemplate
Else
MkDir "c:\xlstart"
Application.AltStartupPath = "c:\xlstart"
ActiveWorkbook.SaveAs Filename:=Application.AltStartupPath &
"\book.xlt", FileFormat:=xlTemplate
End If
ActiveWindow.Close
End Sub

Sub SheetDefault()
Dim Sh
Dim ans As Integer
ans = MsgBox(prompt:="New sheets will be base on this sheet with the
same page setup, view options... Even the content will be the same." &
Chr(13) & Chr(13) & _
"This procedure can not be undone. Do you want to proceed?" &
Chr(13), Buttons:=vbYesNo)
If ans = vbNo Then End
Application.DisplayAlerts = False
ActiveSheet.Copy
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name < ActiveSheet.Name Then Sh.Delete
Next Sh
ActiveSheet.Name = " "
If Application.AltStartupPath < "" And Dir(Application.AltStartupPath,
16) < "" Then
ActiveSheet.SaveAs Filename:=Application.AltStartupPath &
"\sheet.xlt", FileFormat:=xlTemplate
ActiveWindow.Close
End
End If
On Error GoTo 10
ActiveSheet.SaveAs Filename:=Application.StartupPath & "\sheet.xlt",
FileFormat:=xlTemplate
ActiveWindow.Close
End
10: If Application.DefaultFilePath < "" And
Dir(Application.DefaultFilePath, 16) < "" Then
MkDir Application.DefaultFilePath & "\xlstart"
Application.AltStartupPath = Application.DefaultFilePath &
"\xlstart"
ActiveSheet.SaveAs Filename:=Application.AltStartupPath &
"\sheet.xlt", FileFormat:=xlTemplate
Else
MkDir "c:\xlstart"
Application.AltStartupPath = "c:\xlstart"
ActiveSheet.SaveAs Filename:=Application.AltStartupPath &
"\sheet.xlt", FileFormat:=xlTemplate
End If
ActiveWindow.Close
End Sub


Thanks for any input



  #3   Report Post  
Posted to microsoft.public.excel.misc
JackR
 
Posts: n/a
Default Problem when opening Excel

I tried that it is blank. Any other ideas

"Don Guillett" wrote:

try
toolsoptionsgeneral"at startup"

--
Don Guillett
SalesAid Software

"JackR" wrote in message
...
I downlaoded a VBA script from XL-Logic.com called default_wb.zip. I wanted
to try this to see if it would work for my application. It was a sample on
how to automate the creation of workbooks and sheets. It was not what I
thought. Now every time I open a new workbook or sheet in Excel, this
macro
starts and will not give me a blank sheet or workbook. I have copied the
scrip below to see if anyone can figure out how I get rid of this. Please
help, it is driving me crazy. Hee is the text that shows up on the
workbook
when I start it, it is on sheet1, it says
"This workbook contains example macros that show how default sheets and
workbooks can be quickly created using VBA. The code allows you to set up
this workbook as you would like all new workbooks (worksheets) to appear.
When you run the macros, the appropriate default workbook/worksheet is
saved
in the XLstart directory.".
I went to the XL start directory but there is nothing there. Please help.
Here are the two macros:

Sub WorkbookDefault()
Dim ans As Integer
ans = MsgBox(prompt:="New workbooks will be base on this workbook with
the same page setup, view options... Even the content will be the same." &
Chr(13) & Chr(13) & _
"This procedure can not be undone. Do you want to proceed?" &
Chr(13), Buttons:=vbYesNo)
If ans = vbNo Then End
Application.DisplayAlerts = False
If Application.AltStartupPath < "" And Dir(Application.AltStartupPath,
16) < "" Then
ActiveWorkbook.SaveAs Filename:=Application.AltStartupPath &
"\book.xlt", FileFormat:=xlTemplate
ActiveWindow.Close
End
End If
On Error GoTo 10
ActiveWorkbook.SaveAs Filename:=Application.StartupPath & "\book.xlt",
FileFormat:=xlTemplate
ActiveWindow.Close
End
10: If Application.DefaultFilePath < "" And
Dir(Application.DefaultFilePath, 16) < "" Then
MkDir Application.DefaultFilePath & "\xlstart"
Application.AltStartupPath = Application.DefaultFilePath &
"\xlstart"
ActiveWorkbook.SaveAs Filename:=Application.AltStartupPath &
"\book.xlt", FileFormat:=xlTemplate
Else
MkDir "c:\xlstart"
Application.AltStartupPath = "c:\xlstart"
ActiveWorkbook.SaveAs Filename:=Application.AltStartupPath &
"\book.xlt", FileFormat:=xlTemplate
End If
ActiveWindow.Close
End Sub

Sub SheetDefault()
Dim Sh
Dim ans As Integer
ans = MsgBox(prompt:="New sheets will be base on this sheet with the
same page setup, view options... Even the content will be the same." &
Chr(13) & Chr(13) & _
"This procedure can not be undone. Do you want to proceed?" &
Chr(13), Buttons:=vbYesNo)
If ans = vbNo Then End
Application.DisplayAlerts = False
ActiveSheet.Copy
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name < ActiveSheet.Name Then Sh.Delete
Next Sh
ActiveSheet.Name = " "
If Application.AltStartupPath < "" And Dir(Application.AltStartupPath,
16) < "" Then
ActiveSheet.SaveAs Filename:=Application.AltStartupPath &
"\sheet.xlt", FileFormat:=xlTemplate
ActiveWindow.Close
End
End If
On Error GoTo 10
ActiveSheet.SaveAs Filename:=Application.StartupPath & "\sheet.xlt",
FileFormat:=xlTemplate
ActiveWindow.Close
End
10: If Application.DefaultFilePath < "" And
Dir(Application.DefaultFilePath, 16) < "" Then
MkDir Application.DefaultFilePath & "\xlstart"
Application.AltStartupPath = Application.DefaultFilePath &
"\xlstart"
ActiveSheet.SaveAs Filename:=Application.AltStartupPath &
"\sheet.xlt", FileFormat:=xlTemplate
Else
MkDir "c:\xlstart"
Application.AltStartupPath = "c:\xlstart"
ActiveSheet.SaveAs Filename:=Application.AltStartupPath &
"\sheet.xlt", FileFormat:=xlTemplate
End If
ActiveWindow.Close
End Sub


Thanks for any input




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue opening csv files in Excel Emre Yigit Excel Discussion (Misc queries) 3 March 16th 06 07:24 AM
opening text file in excel problem jz193 Excel Discussion (Misc queries) 18 February 10th 06 02:42 PM
Excel crashes while opening excel file imbeddied with macros ct2147 Excel Discussion (Misc queries) 0 December 30th 05 09:05 PM
Opening two separate instances of Excel Ron Bishop Excel Discussion (Misc queries) 2 August 4th 05 05:30 PM
Problem Opening An Excel file. - by yk ilikecy Excel Discussion (Misc queries) 0 February 4th 05 08:19 AM


All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"