Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening in a new book
Is there anyway i can get my spreadsheet to always open in a fesh version of excel even if i already have other books open? -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=396806 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening in a new book
I think the safest thing to do is start another instance of excel.
windows start button|run excel (hit enter) then file|open that other workbook. But by having multiple instances open, you'll find somethings won't work between the two (copying formulas from one instance to another instance, for example). ceemo wrote: Is there anyway i can get my spreadsheet to always open in a fesh version of excel even if i already have other books open? -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=396806 -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening in a new book
I was hoping to be able to do this using code. Perhaps a piece of code that on work book open checks to see how many books are open if more than one if then runs code to open it in a new excel application and close the current spreadsheet. -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=396806 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening in a new book
This might get you started--but I think it's a mistake!
Option Explicit Sub testme() Dim curWkbk As Workbook Dim myFileName As Variant Dim xlApp As Excel.Application myFileName = Application.GetOpenFilename(filefilter:="Excel files, *.xls") If myFileName = False Then Exit Sub 'user hit cancel End If Set curWkbk = Nothing On Error Resume Next Set curWkbk = ActiveWorkbook On Error GoTo 0 If curWkbk Is Nothing Then Set xlApp = Application Else Set xlApp = CreateObject("Excel.Application") xlApp.Visible = True End If xlApp.Workbooks.Open Filename:=myFileName End Sub Notice that in that new instance, none of your addins got loaded. (You'll have to load them yourself.) And you'll have to make sure this code is available in every instance of excel that you start--so you can reuse it. I surely wouldn't do this. ceemo wrote: I was hoping to be able to do this using code. Perhaps a piece of code that on work book open checks to see how many books are open if more than one if then runs code to open it in a new excel application and close the current spreadsheet. -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=396806 -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening in a new book
May be i should exlain why i want this there may be another way. I am using the below to close all menu's when opening a workbook. Private Sub Workbook_Open() Dim oCB As CommandBar For Each oCB In Application.CommandBars oCB.Enabled = False Next oCB mFormulaBar = Application.DisplayFormulaBar Application.DisplayFormulaBar = False application.ignoreremoterequests=true End Sub the last line before end sub stops other work books being opened in the current excel app and opens a new app for them. However if excel is already open when i open this code the other workbooks are affected by the menu changes. This is what i dont want. -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=396806 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening in a new book
And you're opening the files by double clicking on them in windows explorer???
You could try: Tools|options|General tab|Ignore other applications (check it) Then double click on the workbook in windows explorer. And be aware that turning this setting on sometimes gives errors with workbooks that contain spaces in their path/name: C:\my documents\excel\my book.xls The error will look kind of like: cannot find c:\my .. then cannot find documents\excel\my then cannot find book.xls ceemo wrote: May be i should exlain why i want this there may be another way. I am using the below to close all menu's when opening a workbook. Private Sub Workbook_Open() Dim oCB As CommandBar For Each oCB In Application.CommandBars oCB.Enabled = False Next oCB mFormulaBar = Application.DisplayFormulaBar Application.DisplayFormulaBar = False application.ignoreremoterequests=true End Sub the last line before end sub stops other work books being opened in the current excel app and opens a new app for them. However if excel is already open when i open this code the other workbooks are affected by the menu changes. This is what i dont want. -- ceemo ------------------------------------------------------------------------ ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650 View this thread: http://www.excelforum.com/showthread...hreadid=396806 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Replace Book 1 When Opening File in Excel | Excel Discussion (Misc queries) | |||
excel crash when opening work book | Excel Discussion (Misc queries) | |||
How I stopped a Book 1 opening with existing files | Excel Discussion (Misc queries) | |||
How do I stop Book 1 opening with existing files? | Excel Discussion (Misc queries) | |||
Book 1 auto opening | Excel Programming |