#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default open file with code

Seems as though if I open a workbook using Workbooks.Open(Filename:=xxx) and
the file is in use I don't get the "file in use" dialog. I want to know if
I'm opening a read only copy. Any workaround?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 515
Default open file with code

I open files as follows:

varDir = CurDir()
On Error GoTo Opened
Set wSource = Worksheets("----")
Workbooks.Open (varDir & "\----.xls"), _
Notify = False, ReadOnly = False
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Heading
Exit Sub
Opened:
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Your code here, I use a sub name here, to go to the next stage. So if
the next stepis maybe the insertion of headings, which is done with Sub
Headings(), I would put Headings here.


--
HTH

Kassie

Replace xxx with hotmail


"Steve" wrote:

Seems as though if I open a workbook using Workbooks.Open(Filename:=xxx) and
the file is in use I don't get the "file in use" dialog. I want to know if
I'm opening a read only copy. Any workaround?

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
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Excel Discussion (Misc queries) 0 April 23rd 09 08:53 PM
How to Open a file with the help of a code in Excel Pranay Shah New Users to Excel 3 August 22nd 07 02:42 PM
Need VB code for workbook open to open a link Daniel Baker Excel Discussion (Misc queries) 2 August 18th 06 01:30 AM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Code to Open Excel File Please Help Cole Excel Discussion (Misc queries) 2 July 10th 06 09:04 PM


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