Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
command button invisible upon opening file | Excel Programming | |||
File Invisible on opening | Excel Discussion (Misc queries) | |||
Why is ActiveX invisible in Design mode | Excel Programming | |||
Vb macros to schedule the excel sheet invisible mode | Excel Programming | |||
Set Workbook to invisible? | Excel Programming |