ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Read Only alert interference (https://www.excelbanter.com/excel-programming/407777-read-only-alert-interference.html)

stevec

Read Only alert interference
 
Here is my current macro
Sub StockLookup_Update_From_Database()
'
' StockLookup_Update_From_Database Macro
' Macro recorded 2/27/2008 by steve
'

Application.DisplayAlerts = False
Sheets("Stock Lookup").Select
Range("G2").Select
'ChDir "U:\SC\Research\Capital IQ\Hot List\Hot List Database"
'Workbooks.Open Filename:="U:\SC\Research\Capital IQ\Hot List\Hot List
Database\Database -- AR and EQ.xls"

Call Workbooks.Open("U:\SC\Research\Capital IQ\Hot List\Hot List
Database\Database -- AR and EQ.xls", , , , , , True)

'Application.Run "Wait"
'Workbooks.Open Filename:="U:\SC\Research\Capital IQ\Hot List\Hot List
Database\Database -- Stock Lookup -- CAPS.xls"

Call Workbooks.Open("U:\SC\Research\Capital IQ\Hot List\Hot List
Database\Database -- Stock Lookup -- CAPS.xls", , , , , , True)

'Application.Run "Wait"

ThisWorkbook.Activate
Sheets("Stock Lookup").Select
Range("G2:Q2").Select
Selection.Copy
Range("G2:Q6000").Select
ActiveSheet.Paste

Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Selection.Replace What:="#N/A", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("G2").Select

Windows("Database -- AR and EQ.xls").Close
Windows("Database -- Stock Lookup -- CAPS.xls").Close

End Sub

Here is my problem:
1) First of all, the folders that I want to open are already closed -- but I
get the alert that folders are in use by someone else (not true).

2) I'm trying to work around this error in problem 1. So I used this:

Call Workbooks.Open("U:\SC\Research\Capital IQ\Hot List\Hot List
Database\Database -- AR and EQ.xls", , , , , , True)

to try to open the workbooks as a read only file to begin with -- but I
still get the read only alert!

How do I work around this? This issue prevents the macro from moving on...

thanks a lot... Stevec


All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com