Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Opening another instance of Excel

I have a program where I have require a button to open an additional
instance of Excel not just another window within the same instance.

Here is the code I have currently:

'Set variables for document location
ServerLoc = txtMasterServerLoc.Value
Filename = txtMasterFileName.Value

'check to see if the ServerLoc has a '\' at the end and add it if
not
If Right$(ServerLoc, 1) = "\" Then
docloc = ServerLoc & Filename
Else
docloc = ServerLoc & "\" & Filename
End If

'Open the Master Checklist
Workbooks.Open Filename:=docloc

However this doesn't work to open a new instance, it just opens the
document in the same instance of Excel.

Although this isn't a critical fix for this application, i have users
crying that its inconvenient. Love that!!

Thanks guys

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Opening another instance of Excel

WOOT!! thanks, that worked perfectly

'Begin Creating the new Excel Window Objects
Dim xlApp As Object
Set xlApp = CreateObject("excel.application")

'make sure the new Excel window is visible
xlApp.Visible = True

'Open the Master Checklist
xlApp.Workbooks.Open Filename:=docloc

'release the object reference
Set xlApp = Nothing

Thanks Tom

On Dec 15, 12:14 pm, Tom Ogilvy
wrote:
Look in Excel VBA help at CreateObject

--
Regards,
Tom Ogilvy



" wrote:
I have a program where I have require a button to open an additional
instance of Excel not just another window within the same instance.


Here is the code I have currently:


'Set variables for document location
ServerLoc = txtMasterServerLoc.Value
Filename = txtMasterFileName.Value


'check to see if the ServerLoc has a '\' at the end and add it if
not
If Right$(ServerLoc, 1) = "\" Then
docloc = ServerLoc & Filename
Else
docloc = ServerLoc & "\" & Filename
End If


'Open the Master Checklist
Workbooks.Open Filename:=docloc


However this doesn't work to open a new instance, it just opens the
document in the same instance of Excel.


Although this isn't a critical fix for this application, i have users
crying that its inconvenient. Love that!!


Thanks guys- Hide quoted text -- Show quoted text -


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
Help! Excel 2007 opening in a new instance Ryan Martin Excel Discussion (Misc queries) 1 September 4th 08 10:26 PM
Excel opening another instance automatically DanF Excel Discussion (Misc queries) 0 July 9th 08 03:11 PM
opening a new instance of Excel gb4 Setting up and Configuration of Excel 0 April 10th 08 04:48 PM
keep Excel from opening 2nd instance widman Excel Discussion (Misc queries) 0 April 30th 06 01:35 PM
Keep Excel from opening new instance widman Excel Discussion (Misc queries) 7 October 1st 05 01:53 AM


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

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"