Read Only alert interference

S

SteveC

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
 

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

Top