open an external file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know if there is a way to open the file as I am with the code
below, and not have it show up in the Taskbar. In other words, I would like
to make it invisible to the user that the other worksheet is being opened and
closed. Or better yet, do I have to open it at all. Is there a way for
Excel to simply extract the data from the cell in the other worksheet and
return it to me?

Any help is appreciated.

Thank you


Application.ScreenUpdating = False

FileToOpen = "\\netname\N-Drive\common\SAFETY\Safe Days\safedays.xls"
Workbooks.Open FileToOpen
Cells(1,1) = Sheets("Original").Cells(8, 3)
Workbooks("safedays.xls").Close Savechanges:=False

Application.ScreenUpdating = True
 
Vince

This seems ok when the code is run

Sub openwb()
Dim wbname As String
Dim wb As Workbook
Application.ScreenUpdating = False
wbname = "C:\Documents and Settings\Northern Tool\Desktop\PremFix0607.xls"
Set wb = Workbooks.Open(wbname)
wb.Windows(1).Visible = False
Application.ScreenUpdating = True
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 
Nick,
I tried what you suggested, but it still showed in the taskbar, and also
once the line wb.Windows(1).Visible = False is executed you can no longer see
any values contained in the worksheet, so the following line returns a blank.

Cells(1,1) = Sheets("Original").Cells(8, 3)

Thanks for looking at it for me.
 
Ron,
Option 2 "file in nework folder" seems to work fine. I will test some more
with it. Thank you for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top