Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've got some code that plus data from another workbook. It works when the files are in the same instance of Excel; however, if I have the file open in an different instance of Excel the macro doesn't find the specified range. Is it possible to activate this workbook without opening it in the current session of Excel. My code is below: thank ahead of time
If MsgBox("Have you saved BigFile as test1.xls and is that file open?", vbYesNo + vbCritical, "WARNING!") = vbYes The Range(Cells(iRow, 1), Cells(jRow, 12)).ClearContent Windows("test1.xls").Activate |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob Ewers wrote:
Is it possible to activate this workbook without opening it in the current session of Excel. Simple answer: no. More complicated answer: maybe - if you used API calls to find other instances of Excel and then use Automation to see if any of them have Test1.xls open. I don't have details of any suitable API calls with me. Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I understood the question correctly, I have used the following code to
force open a new instance of Excel. Ron Dahl Sub OpenFileInNewInstanceOfExcel() Dim TheName As String Dim oXL As Object On Error Resume Next ' Defer error trapping. ChDir CurDir TheName = Application.GetOpenFilename( _ filefilter:="Excel Files (*.xls), *.xls", _ Title:="Load Excel File") Set oXL = CreateObject("Excel.application") oXL.Workbooks.Open TheName oXL.Application.Visible = True oXL.ActiveWorkbook.RunAutoMacros xlAutoOpen End Sub "Bill Manville" wrote in message ... Bob Ewers wrote: Is it possible to activate this workbook without opening it in the current session of Excel. Simple answer: no. More complicated answer: maybe - if you used API calls to find other instances of Excel and then use Automation to see if any of them have Test1.xls open. I don't have details of any suitable API calls with me. Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Startup and template locations in Citrix TS session and local session | Setting up and Configuration of Excel | |||
Retrieve data from separate Excel session | Charts and Charting in Excel | |||
Activate Workbook | Excel Discussion (Misc queries) | |||
Workbook.activate | Excel Discussion (Misc queries) | |||
excel 2000 workbook.activate not 100% reliable with alt+tab | Excel Programming |