Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA not executing properly in Explorer Window

Status
Not open for further replies.

DrBowes

Programmer
Jul 16, 2003
150
GB

I have put together a spreadsheet which has been placed on an Intranet. The spreadsheet is therefore opened as Excel, but through an Explorer window.

For some reason though when opened through this window the macros don't run properly. There is an error every time you do something using the Range method.

As far as I know, it isn't an earlier Excel version or anything like that.

Any further info on this would be great.

Thanks


 

Skip

The code that it errors on is trivial, just simple range statements e.g.

Sub test()
Range(Cells(1, 1), Cells(2, 2)).Select
End Sub

The message is Run Time Error 1004 - Method 'Range' of object '_Global' failed

I can't see any reason for it, most of the code runs fine, and it is definitely OK in normal Excel.




 

No - I have spent a while with it and am still puzzled.

Thanks for trying though.

 
Try fully quallifying your range object using a Worksheet object...
Code:
Worksheets(MySheet).Range(Cells(1, 1), Cells(2, 2)).Select


Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884

Skip,
 

Have done so, and also using VBA name, still no joy.

In the short term the intranet will link to a Windows Explorer Window containing the spreadsheet so that a proper instance of Excel can be opened instead. This is not ideal but is OK for now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top