Createobject Scripting.filesystemobject Error 424
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this run time error 424 object required vba site About Us Learn more about Stack Overflow the company Business Learn more
Object Required Error Vba
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x excel vba runtime error 424 object required userform Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up trouble with
Runtime Error 424 Object Required Vb6
using filesystemobject in vba up vote 0 down vote favorite I'm having trouble using filesystemobject in a vba function I am writing. I keeping getting the error: Runtime error 424 Object required I have found lots of stuff online but none of it has done any good. Yes I have checked the References and Microsoft Scripting Runtime is checked. Here is as snippet of code compile error object required vba please tell me what I am doing wrong. I have tried changing the first line to Dim objFSO as New FileSystemObject among other things but they are produce the same error. The error occurs on the second line. Dim objFSO Set objFSO = CreateObject(ā€¯Scripting.FileSystemObjectā€¯) vba filesystemobject share|improve this question asked May 21 '12 at 19:25 Ken 42112 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted You are using odd quotes, use plain quotes. Dim objFSO Set objFSO = CreateObject("Scripting.FileSystemObject") share|improve this answer answered May 21 '12 at 19:43 Fionnuala 77k665110 Ahh that's what I get for copying and pasting from the internet. I should have been more aware of that. Thank you –Ken May 21 '12 at 19:49 add a comment| up vote 0 down vote If you add a reference to Microsoft Scripting Runtime, you don't need to use CreateObject; instead you can just call: Dim objFSO=new FileSystemObject share|improve this answer answered May 21 '12 at 23:39 sigil 3,5191361110 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up
your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum
Runtime Error 424 Object Required Excel 2013
that you want to visit from the selection below. Results 1 to 6 of 6
Runtime Error 424 Object Required Vba Access 2010
Thread: Error 424; object required Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch run time error 424 object required vba access to Threaded Mode May 23rd, 2004,03:03 PM #1 tiger756 View Profile View Forum Posts Thread Starter New Member Join Date May 2004 Posts 11 Error 424; object required When I use in my VBScript Code: CreateObject("Scripting.FileSystemObject").GetFile(WScript.ScriptFullName) I http://stackoverflow.com/questions/10691331/trouble-with-using-filesystemobject-in-vba get an Error 424 'object required'. What is wrong? Reply With Quote May 23rd, 2004,04:02 PM #2 visualAd View Profile View Forum Posts VBA Nutter Join Date Apr 2002 Location Camden, London Mode: Remediation Posts 4,906 When you create an object you need to assign its reference to a variable before you can invoke its methods. This slight modification should work: VB Code: Set fso = CreateObject("scripting.filesystemobject")Set file = fso.getFile(wscript.scriptfullname); PHP || MySql || Apache http://www.vbforums.com/showthread.php?291058-Error-424-object-required || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2 | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am. Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!! Spread happiness and joy. Rate good posts. Reply With Quote May 24th, 2004,05:07 AM #3 tiger756 View Profile View Forum Posts Thread Starter New Member Join Date May 2004 Posts 11 Error 424; object required I've done that but it still doesn't work. It works in a .VBS but if I try compiling it with VB6 it doesn't work as an .EXE!! Reply With Quote May 24th, 2004,07:37 AM #4 visualAd View Profile View Forum Posts VBA Nutter Join Date Apr 2002 Location Camden, London Mode: Remediation Posts 4,906 You need to go to the Project->References menu and add a reference to a the Scripting Runtime Library. You can then create an instance of the file system obejct in your code in the normal way. VB Code:
Forum Visual Basic Programming Visual Basic 6.0 Programming object required error for Scripting.FileSystemObject If this http://forums.codeguru.com/showthread.php?532621-object-required-error-for-Scripting-FileSystemObject is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 7 object required of 7 Thread: object required error for Scripting.FileSystemObject Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode January 8th, 2013,02:37 AM #1 puchku View Profile View Forum Posts Junior Member Join Date Dec 2012 Posts 20 object required error for time error 424 Scripting.FileSystemObject am getting runtime error 424-object required on the bold line of following code: ****Dim fs, fname Set fs = Server.CreateObject("Scripting.FileSystemObject") Set fname = fs.CreateTextFile("D:\vb\myfile.txt", True) fname.WriteLine ("something") fname.Close Set fname = Nothing Set fs = Nothing***** which object can possibly be required?any help? thank you in advance... Reply With Quote January 8th, 2013,09:26 AM #2 DataMiser View Profile View Forum Posts Super Moderator Power Poster Join Date Jul 2008 Location WV Posts 5,130 Re: object required error for Scripting.FileSystemObject Is this ASP code or VB6? If it is VB6 then I would advise not using the FSO at all. There is no need for it, the built in functions for file I/O work much better and take fewer resources. As for the object message, clearly it is referring to the FSO Always use [code][/code] tags when posting code. Reply With Quote January 8th, 2013,12:48 PM #3 WoF View Profile View Forum Posts Elite Member Join Date Jul 2006 Location Germany Posts