Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default open an external file

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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default open an external file

Hi Vince

Try this to get the value
http://www.rondebruin.nl/copy7.htm

Or for more workbooks
http://www.rondebruin.nl/ado.htmhttp...l/summary2.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Vince" wrote in message ...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default open an external file

This is better for the second part of my reply

Or for more workbooks
http://www.rondebruin.nl/ado.htm
http://www.rondebruin.nl/summary2.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message ...
Hi Vince

Try this to get the value
http://www.rondebruin.nl/copy7.htm

Or for more workbooks
http://www.rondebruin.nl/ado.htmhttp...l/summary2.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Vince" wrote in message ...
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





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default open an external file

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.


"Nick Hodge" wrote:

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
HIS


"Vince" wrote in message
...
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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default open an external file

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

"Ron de Bruin" wrote:

Hi Vince

Try this to get the value
http://www.rondebruin.nl/copy7.htm

Or for more workbooks
http://www.rondebruin.nl/ado.htmhttp...l/summary2.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Vince" wrote in message ...
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




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
I need open or gain access to an external file P.Grieshop Excel Discussion (Misc queries) 3 March 17th 10 08:12 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
External file references must be open? DavidRennox Excel Discussion (Misc queries) 1 August 3rd 06 09:36 PM
External link only works for numbers -- for text values, #N/A is displayed unless linked file is open Sven Filter Links and Linking in Excel 1 February 22nd 05 08:10 AM
Refreshing External Data on File Open grubstar Excel Programming 3 September 21st 04 05:25 PM


All times are GMT +1. The time now is 04:46 PM.

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"