Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
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
Replace Book 1 When Opening File in Excel Lize Excel Discussion (Misc queries) 0 October 11th 07 12:42 PM
excel crash when opening work book squid509 Excel Discussion (Misc queries) 1 July 6th 07 02:41 PM
How I stopped a Book 1 opening with existing files sirbob Excel Discussion (Misc queries) 0 April 4th 06 07:01 PM
How do I stop Book 1 opening with existing files? sirbob Excel Discussion (Misc queries) 2 April 3rd 06 10:18 AM
Book 1 auto opening Mark Goulty Excel Programming 2 June 16th 04 09:45 AM


All times are GMT +1. The time now is 12:05 PM.

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

About Us

"It's about Microsoft Excel"