Does workbook contain code and links

P

Paul Christie

Does anyone know of a way of finding out if a workbook
has a code module and/or links without opening the
workbook.

I'm writing an import process into an Access Database and
I need to check the file before I open it.

Thanks for any help
 
D

Dave Peterson

First, I know nothing about access, but if you're opening the workbook in excel
(via code), you can turn off the workbook_open macro, and not update the links.


dim mywkbk as workbook
application.enableevents = false
set mywkbk = workbooks.open(filename:="....", updatelinks:=??, ...)
application.enableevents = true

Updatelinks has a few options. You can read about it in help.
 
P

Paul Christie

Dave,

Thanks for this I guess this will have to do. I just felt
there ought to be a way of checking for code before you
open it as a virus protection thing. Some companies in UK
pass spreadsheets around as though a spreadsheet couldn't
contain a virus but of course we know otherwise don't we.

Paul
 

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