ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Excel (https://www.excelbanter.com/excel-programming/301640-open-excel.html)

MD

Open Excel
 


This code does not seem to work for me.

Sub NewExcelWindow()
Set objexcel = New Excel.Application
objexcel.Visible = True
End Sub

A) As soon as the sub ends, the new excel intance closes also.
B) It does not open a workbook inside the new excel intance.

Just like Application.ActivateMicrosoftApp xlMicrosoftWord but for a new
EXCEL intance. I'd like to open a new workbook on a new intance of EXCEL.

PS Why doesn't Application.ActivateMicrosoftApp xlMicrosoftEXCEL work??? It
works for Access, word etc...

Regards,

Michel







Jim Rech

Open Excel
 
Have you dimmed "objexcel" as a module level variable? If not it's local
and goes out of existence when the sub ends.

--
Jim Rech
Excel MVP
"MD" wrote in message
. ..
|
|
| This code does not seem to work for me.
|
| Sub NewExcelWindow()
| Set objexcel = New Excel.Application
| objexcel.Visible = True
| End Sub
|
| A) As soon as the sub ends, the new excel intance closes also.
| B) It does not open a workbook inside the new excel intance.
|
| Just like Application.ActivateMicrosoftApp xlMicrosoftWord but for a new
| EXCEL intance. I'd like to open a new workbook on a new intance of EXCEL.
|
| PS Why doesn't Application.ActivateMicrosoftApp xlMicrosoftEXCEL work???
It
| works for Access, word etc...
|
| Regards,
|
| Michel
|
|
|
|
|
|



MD

Open Excel
 
I have now :-)) ... Now the application (new instance of excel) stays
open.... How do I open a new workbook in that instance.?

thx,

Michel




"Jim Rech" a écrit dans le message de
...
Have you dimmed "objexcel" as a module level variable? If not it's local
and goes out of existence when the sub ends.

--
Jim Rech
Excel MVP
"MD" wrote in message
. ..
|
|
| This code does not seem to work for me.
|
| Sub NewExcelWindow()
| Set objexcel = New Excel.Application
| objexcel.Visible = True
| End Sub
|
| A) As soon as the sub ends, the new excel instance closes also.
| B) It does not open a workbook inside the new excel instance.
|
| Just like Application.ActivateMicrosoftApp xlMicrosoftWord but for a new
| EXCEL instance. I'd like to open a new workbook on a new intance of

EXCEL.
|
| PS Why doesn't Application.ActivateMicrosoftApp xlMicrosoftEXCEL work???
It
| works for Access, word etc...
|
| Regards,
|
| Michel
|
|
|
|
|
|





Jim Rech

Open Excel
 
Dim objexcel as Excel.Application

Sub RunXL
Set objexcel = New Excel.Application
objexcel.Workbooks.Open "C:\MyFile.xls"
objexcel.Visible = True
End Sub

--
Jim Rech
Excel MVP
"MD" wrote in message
. ..
|I have now :-)) ... Now the application (new instance of excel) stays
| open.... How do I open a new workbook in that instance.?
|
| thx,
|
| Michel
|
|
|
|
| "Jim Rech" a écrit dans le message de
| ...
| Have you dimmed "objexcel" as a module level variable? If not it's
local
| and goes out of existence when the sub ends.
|
| --
| Jim Rech
| Excel MVP
| "MD" wrote in message
| . ..
| |
| |
| | This code does not seem to work for me.
| |
| | Sub NewExcelWindow()
| | Set objexcel = New Excel.Application
| | objexcel.Visible = True
| | End Sub
| |
| | A) As soon as the sub ends, the new excel instance closes also.
| | B) It does not open a workbook inside the new excel instance.
| |
| | Just like Application.ActivateMicrosoftApp xlMicrosoftWord but for a
new
| | EXCEL instance. I'd like to open a new workbook on a new intance of
| EXCEL.
| |
| | PS Why doesn't Application.ActivateMicrosoftApp xlMicrosoftEXCEL
work???
| It
| | works for Access, word etc...
| |
| | Regards,
| |
| | Michel
| |
| |
| |
| |
| |
| |
|
|
|
|




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com