|
-
August 3rd, 2005, 01:21 PM
#1
Option Strict ON !?!?
Need help understanding the error.
Dim xL as Excel.Application
xL.Sheets("General").activate() --> Error here telling "Option Strict disallows late binding"
what am i doing wrong ?
Thanks in advance
Sihi
-
August 3rd, 2005, 02:13 PM
#2
Re: Option Strict ON !?!?
try this
' this xlapp.workbooks(1).worksheets("General") returns a reference to an Object and not a reference to a worksheet.
Dim xlwork As Excel.Worksheet
' This line explicitly tells the compiler that you're going to cast xlapp.workbooks(1).worksheets as a excel.worksheet and as such
it should return a reference on a worksheet instead of an object
xlwork = ctype(xlapp.Workbooks(1).Worksheets("GENERAL"),excel.worksheet)
xlwork.activate()
Last edited by Boumxyz2; August 3rd, 2005 at 02:18 PM.
Nicolas Bohemier
-
August 4th, 2005, 08:56 AM
#3
Re: Option Strict ON !?!?
Thanks guru, it works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|