10-30-2007, 01:27 AM #4 unclejoe Registered User Join Date: Dec 2004 Location: singapore Excel 2010 Vba Runtime Error 91

You attempted to use an object variable that has been set to Nothing. I do however have a fair amount of Public/Global variables, mainly type String or Integer. ExcelVBAHelp 175 views 12:54 Error Handling Excel VBA - Duration: 9:43. this page For example, use a new Set statement to set a new reference to the object.

ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms Reply With Quote Jul 2nd, 2012,04:07 AM #5 gracehskuo View Profile View Forum Posts Thread Starter Fanatic Member Join Run-time Error '91' Object Variable Or With Block Variable Not Set Code: Db.CreateQueryDef("NAME", "SQL, if appropriate") Isn't that what you are trying to do?? Featured Post IT Security CISA, CISSP & CISM Certification Promoted by Experts Exchange Master the advanced techniques required to protect network resources from external threats with the IT Cyber Security bundle.

Join Date Aug 2007 Location India Posts 2,158 Re: Run-time error 91 Object variable or With block variable not set grace, u r confusing with DAO and ADO, try this code,

Why does this progression alternating between major and minor chords sound right? The Spreadsheet Guru 1,193 views 4:24 Excel VBA Basics #9 - Declaring variables with DIM and using SET to abbreviate worksheet name - Duration: 8:04. The target of a GoTo statement is inside a With block. Run Time Error 91 Vba Richard Hollenbeck wrote: Problem solved.

ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms Reply With Quote Jul 2nd, 2012,03:33 AM #3 gracehskuo View Profile View Forum Posts Thread Starter Fanatic Member Join Loading... TempVars look very enticing if i were creating a new application. http://axisnice.com/time-error/access-2007-runtime-error-3044.php It may be something stupid but I've been staring at this error trying to fix it for over an hour.

What is this cable hanging against the outer wall? See ASP.NET Ajax CDN Terms of Use – http://www.asp.net/ajaxlibrary/CDN.ashx. ]]> current community chat Stack Overflow Meta Stack Overflow your Sign in 9 0 Don't like this video? Public Function GetNextNumber() As Variant Dim strSQL As String Dim rs As Recordset GetNextNumber= Null // creating sql to execute MYSP stored procedures with 2 parameteres strSQL = "EXEC MySP '"

If entering data into the subform manually is not working properly, your controls are not bound. Set MyObject = Sheets(1) ' Create valid object reference. How to deal with a very weak student What is a plural of "To-Do"? "To-Dos" or "To-Does"? Is it posible to hook the tilt of a curve's point?

This error can occur on a single line of code or within a With Statement Want More check out this linkhttps://msdn.microsoft.com/en-us/libr...-~-~~-~~~-~~-~-Please watch: "Excel VBA Request a Video" https://www.youtube.com/watch?v=NO7Ew...-~-~~-~~~-~~-~- Category Education License The content you requested has been removed. Add to Want to watch this again later? Code: Set rs1 = OpenRecordset("select distinct EmployeeNo From Employee,WHERE Status = 'Active'", adOpenStatic, adLockReadOnly) Seenu If this post is useful, pls don't forget to Rate this post.