How to open a new instance of EXCEL and .xls file

  • Thread starter Thread starter Launchnet
  • Start date Start date
L

Launchnet

I need a macro that will open a second Excel program and open a specific file
name "name.xls" at the same time.

I could also use a macro that would only open a second Excel program with an
empty workbook.

Thanks in advance for your help.

Matt @ Launchnet
 
Sub NewExcel()
Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
Set oWB = oXL.Workbooks.Open("C:\myBook.xls")
'...
Set oWB = Nothing
oXL.Quit
Set oXL = Nothing
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Good Morning Bob

Thanks for Macro, But I do have a problem. First, I copied the code directly
to my macro sheet. The code in Macro is now:

Sub NewExcel()
Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
Set oWB = oXL.Workbooks.Open("C:\documents and settings\default\my
documents\computerclasshandouts.xls")
'...
Set oWB = Nothing
oXL.Quit
Set oXL = Nothing
End Sub


When I click on my macro, it opens a new instance of Excel and the desired
file (which I can see for a moment, but then it immediately closes and I only
have my original worksheet.

Any ideas would be appreciated.

Thanks
Matt@Launchnet

Bob said:
Sub NewExcel()
Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
Set oWB = oXL.Workbooks.Open("C:\myBook.xls")
'...
Set oWB = Nothing
oXL.Quit
Set oXL = Nothing
End Sub
I need a macro that will open a second Excel program and open a specific
file
[quoted text clipped - 7 lines]
Matt @ Launchnet

--
Please take a look at www.openoursite.com and you will see how I want to
use.

God Bless for helping

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
LOL! Yes, my code will do that.

This bit

'...

is where you should do what you want to do. If you don't want to do
anything, just have the extar instance of Excel, remove


Set oWB = Nothing
oXL.Quit
Set oXL = Nothing

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Launchnet via OfficeKB.com said:
Good Morning Bob

Thanks for Macro, But I do have a problem. First, I copied the code
directly
to my macro sheet. The code in Macro is now:

Sub NewExcel()
Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
Set oWB = oXL.Workbooks.Open("C:\documents and settings\default\my
documents\computerclasshandouts.xls")
'...
Set oWB = Nothing
oXL.Quit
Set oXL = Nothing
End Sub


When I click on my macro, it opens a new instance of Excel and the desired
file (which I can see for a moment, but then it immediately closes and I
only
have my original worksheet.

Any ideas would be appreciated.

Thanks
Matt@Launchnet

Bob said:
Sub NewExcel()
Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
Set oWB = oXL.Workbooks.Open("C:\myBook.xls")
'...
Set oWB = Nothing
oXL.Quit
Set oXL = Nothing
End Sub
I need a macro that will open a second Excel program and open a specific
file
[quoted text clipped - 7 lines]
Matt @ Launchnet

--
Please take a look at www.openoursite.com and you will see how I want to
use.

God Bless for helping

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
Many Thanks Bob

I removed the 3 lines of code and it works perfect.

Now, I need a macro to simply open a new instance of Excel.
So, I tried copying the workable code to a new macro and rem'd out:
'Set oWB = oXL.Workbooks.Open("C:\documents and settings\default\my documents\
computerclasshandouts.xls")

Well, it didn't do anything except flash or blink the existing copy of Excel
that the original macro is in.

Can I please ask for help one more time ?

Matt@Launchnet

Bob said:
LOL! Yes, my code will do that.

This bit

'...

is where you should do what you want to do. If you don't want to do
anything, just have the extar instance of Excel, remove

Set oWB = Nothing
oXL.Quit
Set oXL = Nothing
Good Morning Bob
[quoted text clipped - 44 lines]

--
Please take a look at www.openoursite.com and you will see how I want to
use.

God Bless for helping

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
Matt,

Just to check, can you post the actual code that you now have?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Launchnet via OfficeKB.com said:
Many Thanks Bob

I removed the 3 lines of code and it works perfect.

Now, I need a macro to simply open a new instance of Excel.
So, I tried copying the workable code to a new macro and rem'd out:
'Set oWB = oXL.Workbooks.Open("C:\documents and settings\default\my
documents\
computerclasshandouts.xls")

Well, it didn't do anything except flash or blink the existing copy of
Excel
that the original macro is in.

Can I please ask for help one more time ?

Matt@Launchnet

Bob said:
LOL! Yes, my code will do that.

This bit

'...

is where you should do what you want to do. If you don't want to do
anything, just have the extar instance of Excel, remove

Set oWB = Nothing
oXL.Quit
Set oXL = Nothing
Good Morning Bob
[quoted text clipped - 44 lines]
Matt @ Launchnet

--
Please take a look at www.openoursite.com and you will see how I want to
use.

God Bless for helping

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
Bob . . this is what I tried

Sub NewExcelOnly()
Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
'Set oWB = oXL.Workbooks.Open("C:\documents and settings\default\my
documents\computerclasshandouts.xls")
End Sub

what does your wording mean: >[quoted text clipped - 32 lines]

Thanks on a Sunday Morning. On my way to church. I Love the Lord.

Matt

Bob said:
Matt,

Just to check, can you post the actual code that you now have?
Many Thanks Bob
[quoted text clipped - 32 lines]

--
Please take a look at www.openoursite.com and you will see how I want to
use.

God Bless for helping

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
Matt,

You are right, if we don't give that instance anything to work on, it seems
to shutdown down immediately.

Try this

Sub NewExcel()
Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
oXL.Workbooks.Add
Set oXL = Nothing
End Sub

I am afraid I don't underestand the relevance of your question ...
what does your wording mean: >[quoted text clipped - 32 lines]

nor your final statement ...


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Launchnet via OfficeKB.com said:
Bob . . this is what I tried

Sub NewExcelOnly()
Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
'Set oWB = oXL.Workbooks.Open("C:\documents and settings\default\my
documents\computerclasshandouts.xls")
End Sub

what does your wording mean: >[quoted text clipped - 32 lines]

Thanks on a Sunday Morning. On my way to church. I Love the Lord.

Matt

Bob said:
Matt,

Just to check, can you post the actual code that you now have?
Many Thanks Bob
[quoted text clipped - 32 lines]
Matt @ Launchnet

--
Please take a look at www.openoursite.com and you will see how I want to
use.

God Bless for helping

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
Thanks Again . . . The code works great.

I'm going to look at your code and see if I can set it up to also have
separate links (macros) for opening "Word", "Access" and "Windows Explorer".
I'm not asking for help yet. I try to learn everything that I can before I
ask for assistance. As my story goes, I have to learn . . .

I have developed a menu system that people love and I am just putting the
finishing touches on it. Maybe someday you will see it.

REPLY TO YOUR QUESTION:
My question was, what did ["quoted text clipped = 32 lines"] stand for. Now
I know. I have never seen it before or at least never noticed it before. It
simply displays the number of lines copied from an above message and used as
a quote.

"Thanks on a Sunday Morning. On my way to church. I Love the Lord."

This statement means 3 things.
1. . . I thank you for your reply this Sunday Morning.
2. . . Just stating that I had to hurry for I was on my way to church.
3. . . Jesus Christ is my Lord and he means alot to me. By the way, I can
prove how much he has done for me. Go to my site www.openoursite.com and
click on "Keywords:"
Select "Matt's Story." I hope you find it interesting.
The Red 1961 Chrysler on the Home Page is near perfect and I own it.

Needless to say, I also like Classic Cars.

Still alot of work to do on my website. Hope to be done (still lots of
updates to do) soon. Word of mouth is giving me quite a few hits . . . No
Meta Tags, No Submission to Search Engines . . . No Advertising. Wait until
its finished. It appears that it is on it's way to success. I have a
special application in the site that has not been finished yet, but several
large companys already want to promote the site when I have completed this
application.

Many Many Thanks Bob . . . On a Sunday afternoon.

Hope I haven't made this too long for you.

Matt@Launchnet




Bob said:
Matt,

You are right, if we don't give that instance anything to work on, it seems
to shutdown down immediately.

Try this

Sub NewExcel()
Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
oXL.Workbooks.Add
Set oXL = Nothing
End Sub

I am afraid I don't underestand the relevance of your question ...
what does your wording mean: >[quoted text clipped - 32 lines]

nor your final statement ...
Bob . . this is what I tried
[quoted text clipped - 23 lines]

--
Please take a look at www.openoursite.com and you will see how I want to
use.

God Bless for helping

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 
On the contrary, it made a more interesting read than most <g>

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Launchnet via OfficeKB.com said:
Thanks Again . . . The code works great.

I'm going to look at your code and see if I can set it up to also have
separate links (macros) for opening "Word", "Access" and "Windows
Explorer".
I'm not asking for help yet. I try to learn everything that I can before
I
ask for assistance. As my story goes, I have to learn . . .

I have developed a menu system that people love and I am just putting the
finishing touches on it. Maybe someday you will see it.

REPLY TO YOUR QUESTION:
My question was, what did ["quoted text clipped = 32 lines"] stand for.
Now
I know. I have never seen it before or at least never noticed it before.
It
simply displays the number of lines copied from an above message and used
as
a quote.

"Thanks on a Sunday Morning. On my way to church. I Love the Lord."

This statement means 3 things.
1. . . I thank you for your reply this Sunday Morning.
2. . . Just stating that I had to hurry for I was on my way to church.
3. . . Jesus Christ is my Lord and he means alot to me. By the way, I can
prove how much he has done for me. Go to my site www.openoursite.com
and
click on "Keywords:"
Select "Matt's Story." I hope you find it interesting.
The Red 1961 Chrysler on the Home Page is near perfect and I own it.

Needless to say, I also like Classic Cars.

Still alot of work to do on my website. Hope to be done (still lots of
updates to do) soon. Word of mouth is giving me quite a few hits . . . No
Meta Tags, No Submission to Search Engines . . . No Advertising. Wait
until
its finished. It appears that it is on it's way to success. I have a
special application in the site that has not been finished yet, but
several
large companys already want to promote the site when I have completed this
application.

Many Many Thanks Bob . . . On a Sunday afternoon.

Hope I haven't made this too long for you.

Matt@Launchnet




Bob said:
Matt,

You are right, if we don't give that instance anything to work on, it
seems
to shutdown down immediately.

Try this

Sub NewExcel()
Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
oXL.Visible = True
oXL.Workbooks.Add
Set oXL = Nothing
End Sub

I am afraid I don't underestand the relevance of your question ...
what does your wording mean: >[quoted text clipped - 32 lines]

nor your final statement ...
Please take a look at www.openoursite.com and you will see how I
want
to use.
Bob . . this is what I tried
[quoted text clipped - 23 lines]
Matt @ Launchnet

--
Please take a look at www.openoursite.com and you will see how I want to
use.

God Bless for helping

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-functions/200706/1
 

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

Similar Threads


Back
Top