LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Access an open workbook without making it active

Is there any way to run my code below without actually making workbook
Employee_List active? It is open in the background.

Private Sub Edit_Name_Click()

If ListBox1.Value = " " Then GoTo BlankList

Unload EmployeeList

Application.ScreenUpdating = False
Application.EnableEvents = False

Dim rng As Range, rng1 As Range
Dim sStr As String

Set rng = Workbooks("EmployeeList.xlsm").Worksheets("Employe e_List").Cells
sStr = Me.TextBox1.Value

Set rng1 = rng.Find(What:=sStr, _
After:=Range("IV65536"), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng1 Is Nothing Then
Workbooks("EmployeeList.xlsm").Activate
ActiveWorkbook.Worksheets("Employee_List").Activat e
rng1.Select

Else
MsgBox sStr & " not found"
End If

Application.Run "EmployeeList.xlsm!UpdateName"
Application.ScreenUpdating = True

Workbooks("Vacation - Leave Book Master.xls").Activate
EmployeeList.Show

Application.EnableEvents = True

BlankList:

End Sub
 
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
Copy Range from Open Workbook to Active Workbook Forgone Excel Programming 0 July 17th 09 01:46 AM
Access current active workbook from DLL hon123456 Excel Programming 1 September 8th 06 08:00 AM
Making an open workbook active Jay Oken Excel Programming 1 March 19th 05 11:44 PM
Get range value active workbook on open add-in Ajtb Excel Programming 1 February 11th 05 01:52 PM
How do I make an open workbook the active workbook Don Guillett[_4_] Excel Programming 0 December 30th 03 04:28 PM


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