Odd reference issue (1 Viewer)

Malcy

Registered User.
Local time
Today, 23:44
Joined
Mar 25, 2003
Messages
586
Using ACC2007 and calling Excell 2007
I ran this module without issue last night but today it is throwing me a compile error as "object library feature not supported" with oSheet highlighted.
The line causing the problem is
Code:
    Set oSheet = xlwkb.Sheets("qryGMExport")
oSheet is dimmed as Excel.Workbook and there is a reference to Microsoft Excell 12.0 Object Library. The purpose is to manipulate formatting on a worksheet.
The only difference is I have added a line at the bottom to open the Excel file on screen
Code:
FollowHyperlink strPathFile
However, if I comment this out the compile still fails so it isn't that.
Any thoughts as to why/what?? Any help much appreciated. Thanks
 

Rabbie

Super Moderator
Local time
Today, 23:44
Joined
Jul 10, 2007
Messages
5,906
It may be worth dimming oSheet as Excel.Worksheet
 

Malcy

Registered User.
Local time
Today, 23:44
Joined
Mar 25, 2003
Messages
586
Thanks Rabbie but it already is!
Code:
    Dim oSheet As Excel.Worksheet
That is what is so puzzling.
 

Malcy

Registered User.
Local time
Today, 23:44
Joined
Mar 25, 2003
Messages
586
Sorry my stupid - too much haste!
Anyway issue now sorted. For future reference what I did was uncheck the reference to Excel 12.0 then close references and save VBA. Then reopen VBA and re-check the Excel 12.0, save, and away it went without so much as a by your leave.
At a loss to explain!
Thanks for the help anyway

Malcy
 

Users who are viewing this thread

Top Bottom