Auto_Open Code on Worksheet

T

Tony

I receive an Excel workbook that runs an Auto_Open routine not from VBA, but
from a worksheet named "Macro1" with each of the macros defined as names in
the workbook (see sample below). Access 2007 will not let me import the
worksheet with this Auto_Open routine. Can anyone point me in a direction to
disable this Auto_Open macro in Excel? The Auto_Open is in column B, while
the other 21 macros are in column A.

Auto_Open
=ERROR(2,Recover)
=WORKBOOK.SELECT("Data Sheet 1")
=WINDOW.RESTORE()
=WINDOW.SIZE(82.5,42.75)
=WORKBOOK.HIDE("Macro1",TRUE)
=EDIT.COLOR(1,0,0,0)
=RUN("Macro20")
=DELETE.NAME("Auto_Open")
=WORKBOOK.SELECT("Data sheet 1")
=SELECT("R3:R65536")
=SELECT("R1C1")
=WINDOW.MAXIMIZE()
=RETURN()
 
J

Joel

You need to open the workbook in readonly mode. try this code

Sub Openbook()

filetoopen = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")
Workbook.Open Filename:=filetoopen, ReadOnly:=True

End Sub
 
T

Tony

Great! This forum is the first stop when I'm trying to resolve an issue with
Excel VBA and the community never fails to let me down! Thank you very much.
 

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