Compile error in (non-existent) hidden module

ian_bamforth
06-30-2010, 07:25 AM
Hi,

I have a spreadsheet which has a bunch of macros in. It works fine on most machines at work, and up until a couple of days ago worked fine on all of them. A couple of users now have a problem where every time one of the macros runs, they get an error "Compile error in hidden module: Sheet1". The thing I find most confusing is that Sheet1 does not exist - all my sheets have names and are visible. All users have the same version of Office, and although there is a mix of XP SP2 and SP3, the split between service packs does not correlate to whether the macros work or not.

Unfortunately these machines are on a remote site, so I haven't been able to reproduce the error properly yet.

Ian

ian_bamforth
07-01-2010, 12:20 AM
Hello again,

Having gained access to the remote machines, I debugged the workbook and discovered I had a few un-dimensioned variables. It appears that the machines displaying a problem had an issue whereby I could not add references to VBA project - Tools -> References brought up an error message: Error accessing the system registry.

Anyway, by correctly declaring my variables I have been able to work round this issue. I'll leave it to the IT department to worry about why I can't add references on these machines!

Thanks,

Ian

Colin Legg
07-01-2010, 02:24 AM
Hi Ian,

I recommend you include an Option Explicit statement in all your code modules. This will enforce variable declaration.

Visvang
07-01-2010, 09:36 AM
i had this exact same error today, i went into debug mode, highlited the problem pressed F1 and untick the highlited item.

Im not sure if it is in fact the same error but if it is this is a simple and quick fix

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum