Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Opening workbook in invisible mode?

This code doesn't quite do what I want:

Set wbRemote = Workbooks.Open(temp, , True)

First, it opens the workbooks visibly, while I wish it to open in a hidden state. Second (probably due to the first), it changes the ActiveWorkbook. I also tried this

Set xlTmp = New Excel.Application
xlTmp.Workbooks.Open temp, , True

This works, but I it lacks in clarity. I like having a Workbook object to refer to, rather than the Excel.Application object, which I'm less familiar with. Any hints on how to get a Workbook object referring to an open (but invisible) workbook?

Gustaf
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default Opening workbook in invisible mode?

Try somthing like this...

Private Sub Workbook_Open()
Dim xl As Object
Dim wrkBook As Object

Set xl = CreateObject("Excel.Application")
Set wrkBook = xl.Workbooks.Add

xl.Visible = False
With wrkBook.Worksheets(1)
.Cells(1, 1).Value = "Hello"
.Cells(1, 2).Value = "world"
End With

End Sub


"Gustaf" wrote:

This code doesn't quite do what I want:

Set wbRemote = Workbooks.Open(temp, , True)

First, it opens the workbooks visibly, while I wish it to open in a hidden state. Second (probably due to the first), it changes the ActiveWorkbook. I also tried this

Set xlTmp = New Excel.Application
xlTmp.Workbooks.Open temp, , True

This works, but I it lacks in clarity. I like having a Workbook object to refer to, rather than the Excel.Application object, which I'm less familiar with. Any hints on how to get a Workbook object referring to an open (but invisible) workbook?

Gustaf

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Opening workbook in invisible mode?

Maybe a simple option is to open an .xla rather than an .xls.

RBS


"Gustaf" wrote in message
...
This code doesn't quite do what I want:

Set wbRemote = Workbooks.Open(temp, , True)

First, it opens the workbooks visibly, while I wish it to open in a hidden
state. Second (probably due to the first), it changes the ActiveWorkbook.
I also tried this

Set xlTmp = New Excel.Application
xlTmp.Workbooks.Open temp, , True

This works, but I it lacks in clarity. I like having a Workbook object to
refer to, rather than the Excel.Application object, which I'm less
familiar with. Any hints on how to get a Workbook object referring to an
open (but invisible) workbook?

Gustaf


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Opening workbook in invisible mode?

First, you can define a workbook object.
dim myWB as excel.workbook

and replace this
xlTmp.Workbooks.Open temp, , True

with this
Set myWB = xlTmp.Workbooks.Open ( temp, , True )

Then you can use the workbook object. The application object works much the
same as the workbook object.

If you don't want to see what's happening on the screen during execution,
put this

XlTMP.Screenupdating = false (after you define it)

and reset to TRUE when execution is done

HTH,
Barb Reinhardt

"Gustaf" wrote:

This code doesn't quite do what I want:

Set wbRemote = Workbooks.Open(temp, , True)

First, it opens the workbooks visibly, while I wish it to open in a hidden state. Second (probably due to the first), it changes the ActiveWorkbook. I also tried this

Set xlTmp = New Excel.Application
xlTmp.Workbooks.Open temp, , True

This works, but I it lacks in clarity. I like having a Workbook object to refer to, rather than the Excel.Application object, which I'm less familiar with. Any hints on how to get a Workbook object referring to an open (but invisible) workbook?

Gustaf

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Opening workbook in invisible mode?

Set oWb = xlTmp.Workbooks.Open(temp)
--
Jim Cone
Portland, Oregon USA


"Gustaf"
wrote in message

This code doesn't quite do what I want:

Set wbRemote = Workbooks.Open(temp, , True)

First, it opens the workbooks visibly, while I wish it to open in a hidden state. Second (probably due to the first), it changes the
ActiveWorkbook. I also tried this

Set xlTmp = New Excel.Application
xlTmp.Workbooks.Open temp, , True

This works, but I it lacks in clarity. I like having a Workbook object to refer to, rather than the Excel.Application object, which
I'm less familiar with. Any hints on how to get a Workbook object referring to an open (but invisible) workbook?

Gustaf



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Opening workbook in invisible mode?

Gustaf wrote:

familiar with. Any hints on how to get a Workbook object referring to an
open (but invisible) workbook?


Many thanks for all the help on this.

Gustaf
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
command button invisible upon opening file Joe Excel Programming 2 January 28th 08 07:32 PM
File Invisible on opening helvetik Excel Discussion (Misc queries) 2 April 12th 06 03:14 PM
Why is ActiveX invisible in Design mode [email protected] Excel Programming 1 February 7th 05 09:37 AM
Vb macros to schedule the excel sheet invisible mode psk[_2_] Excel Programming 2 October 27th 04 12:17 AM
Set Workbook to invisible? S. Daum Excel Programming 1 August 6th 03 09:46 PM


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