Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default personal.xls doesn't launch in COM

I've written some could that launches excel and populates a new
worksheet using COM, Unfortunately, when I launch Excel through my COM
script, it does not open my hidded Personal.xls workbook. I need this
to open for the user so they can use macros that are stored there.

Any ideas??

TIA

Here's a snippet of my code:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.Workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.Workbooks(1).Worksheets(1)

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default personal.xls doesn't launch in COM

This worked when I tested it using MSWord's VBA:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.workbooks.Open FileName:=xlApp.StartupPath & "\" & "personal.xls"
xlApp.workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.workbooks(1).Worksheets(1)

========
If your personal.xls workbook has an auto_open procedure that you need to run:

Dim xlApp As Variant
Dim xlsheet As Variant
Dim xlWkbk As Object

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
Set xlWkbk = xlApp.workbooks.Open _
(FileName:=xlApp.StartupPath & "\" & "personal.xla")
xlWkbk.RunAutoMacro 1 'xlautoopen

xlApp.workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.workbooks(1).Worksheets(1)




wrote:

I've written some could that launches excel and populates a new
worksheet using COM, Unfortunately, when I launch Excel through my COM
script, it does not open my hidded Personal.xls workbook. I need this
to open for the user so they can use macros that are stored there.

Any ideas??

TIA

Here's a snippet of my code:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.Workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.Workbooks(1).Worksheets(1)


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default personal.xls doesn't launch in COM

Ps. My personal.xl* is .xla. I forgot to change the extension back to .xls in
the second example.

Dave Peterson wrote:

This worked when I tested it using MSWord's VBA:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.workbooks.Open FileName:=xlApp.StartupPath & "\" & "personal.xls"
xlApp.workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.workbooks(1).Worksheets(1)

========
If your personal.xls workbook has an auto_open procedure that you need to run:

Dim xlApp As Variant
Dim xlsheet As Variant
Dim xlWkbk As Object

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
Set xlWkbk = xlApp.workbooks.Open _
(FileName:=xlApp.StartupPath & "\" & "personal.xla")
xlWkbk.RunAutoMacro 1 'xlautoopen

xlApp.workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.workbooks(1).Worksheets(1)

wrote:

I've written some could that launches excel and populates a new
worksheet using COM, Unfortunately, when I launch Excel through my COM
script, it does not open my hidded Personal.xls workbook. I need this
to open for the user so they can use macros that are stored there.

Any ideas??

TIA

Here's a snippet of my code:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.Workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.Workbooks(1).Worksheets(1)


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default personal.xls doesn't launch in COM

Thanks for the idea Dave. One problem I have is I can't remember how
to handle VBA methods that use ":=". I'm using COM in LotusScript.

Any ideas??


Dave Peterson wrote:
This worked when I tested it using MSWord's VBA:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.workbooks.Open FileName:=xlApp.StartupPath & "\" & "personal.xls"
xlApp.workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.workbooks(1).Worksheets(1)

========
If your personal.xls workbook has an auto_open procedure that you need to run:

Dim xlApp As Variant
Dim xlsheet As Variant
Dim xlWkbk As Object

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
Set xlWkbk = xlApp.workbooks.Open _
(FileName:=xlApp.StartupPath & "\" & "personal.xla")
xlWkbk.RunAutoMacro 1 'xlautoopen

xlApp.workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.workbooks(1).Worksheets(1)




wrote:

I've written some could that launches excel and populates a new
worksheet using COM, Unfortunately, when I launch Excel through my COM
script, it does not open my hidded Personal.xls workbook. I need this
to open for the user so they can use macros that are stored there.

Any ideas??

TIA

Here's a snippet of my code:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.Workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.Workbooks(1).Worksheets(1)


--

Dave Peterson


  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default personal.xls doesn't launch in COM

Sorry.

Just leave the keyword out (filename is the first in the list of positional
parameters):

xlApp.workbooks.Open FileName:=xlApp.StartupPath & "\" & "personal.xls"
becomes
xlApp.workbooks.Open xlApp.StartupPath & "\" & "personal.xls"

Same thing with the second example.

wrote:

Thanks for the idea Dave. One problem I have is I can't remember how
to handle VBA methods that use ":=". I'm using COM in LotusScript.

Any ideas??

Dave Peterson wrote:
This worked when I tested it using MSWord's VBA:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.workbooks.Open FileName:=xlApp.StartupPath & "\" & "personal.xls"
xlApp.workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.workbooks(1).Worksheets(1)

========
If your personal.xls workbook has an auto_open procedure that you need to run:

Dim xlApp As Variant
Dim xlsheet As Variant
Dim xlWkbk As Object

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
Set xlWkbk = xlApp.workbooks.Open _
(FileName:=xlApp.StartupPath & "\" & "personal.xla")
xlWkbk.RunAutoMacro 1 'xlautoopen

xlApp.workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.workbooks(1).Worksheets(1)




wrote:

I've written some could that launches excel and populates a new
worksheet using COM, Unfortunately, when I launch Excel through my COM
script, it does not open my hidded Personal.xls workbook. I need this
to open for the user so they can use macros that are stored there.

Any ideas??

TIA

Here's a snippet of my code:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.Workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.Workbooks(1).Worksheets(1)


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default personal.xls doesn't launch in COM

Thanks Dave,

That worked great.

Dave Peterson wrote:
Sorry.

Just leave the keyword out (filename is the first in the list of positional
parameters):

xlApp.workbooks.Open FileName:=xlApp.StartupPath & "\" & "personal.xls"
becomes
xlApp.workbooks.Open xlApp.StartupPath & "\" & "personal.xls"

Same thing with the second example.

wrote:

Thanks for the idea Dave. One problem I have is I can't remember how
to handle VBA methods that use ":=". I'm using COM in LotusScript.

Any ideas??

Dave Peterson wrote:
This worked when I tested it using MSWord's VBA:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.workbooks.Open FileName:=xlApp.StartupPath & "\" & "personal.xls"
xlApp.workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.workbooks(1).Worksheets(1)

========
If your personal.xls workbook has an auto_open procedure that you need to run:

Dim xlApp As Variant
Dim xlsheet As Variant
Dim xlWkbk As Object

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
Set xlWkbk = xlApp.workbooks.Open _
(FileName:=xlApp.StartupPath & "\" & "personal.xla")
xlWkbk.RunAutoMacro 1 'xlautoopen

xlApp.workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.workbooks(1).Worksheets(1)




wrote:

I've written some could that launches excel and populates a new
worksheet using COM, Unfortunately, when I launch Excel through my COM
script, it does not open my hidded Personal.xls workbook. I need this
to open for the user so they can use macros that are stored there.

Any ideas??

TIA

Here's a snippet of my code:

Dim xlApp As Variant
Dim xlsheet As Variant

Set xlApp = CreateObject("Excel.Application")
xlApp.StatusBar = "Creating WorkSheet. Please be patient..."
xlApp.Visible = True
xlApp.Workbooks.Add
xlApp.ReferenceStyle = 2
Set xlsheet = xlApp.Workbooks(1).Worksheets(1)

--

Dave Peterson


--

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
Personal.xls gone Zurn Excel Discussion (Misc queries) 6 April 26th 06 08:10 AM
Personal.xls opens when I launch Excel kenk Excel Discussion (Misc queries) 1 December 7th 05 03:18 PM
problem from Personal.xls Tom Setting up and Configuration of Excel 4 July 4th 05 11:38 PM
Personal.xls Cathy Excel Discussion (Misc queries) 1 January 28th 05 12:50 AM
Personal.xls and Excel.xlb Terry Excel Discussion (Misc queries) 1 January 26th 05 01:49 AM


All times are GMT +1. The time now is 03:03 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"