Filesystemobject Object Required Error
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 site About Us Learn more about runtime error 424 object required Stack Overflow the company Business Learn more about hiring developers or posting ads with object required error in vbscript us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a error 424 object required vbscript community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up trouble with using filesystemobject in vba up vote 0 down vote favorite I'm having trouble microsoft vbscript runtime error '800a01a8' object required 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 please tell me what I am doing wrong. I have tried changing the first line to Dim objFSO
Object Required Vba
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 77.1k665110 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,5191362112 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the a
a Question Need help? Post your question and get tips & solutions from a community of 418,551 IT Pros & Developers. It's quick & easy. 'object required' error using
Microsoft Vbscript Runtime Error Object Required ' String
FileSystemObject P: n/a google I am trying to use the following ASP code vbscript runtime error permission denied to examine the file names in a folder: Dim fso, f, fl, s, fs Set fso = CreateObject("Scripting.FileSystemObject") Set f object required fso vbscript = fso.GetFolder("C:\Inetpub\wwwroot\MySite\subfolder ") Set fs = f.Files For Each fl in fs s = fl.Name 'Object Required error occurs here! Response.Write(s) Next Set fso = Nothing The asp page returns the 'Object Required' error http://stackoverflow.com/questions/10691331/trouble-with-using-filesystemobject-in-vba on the line, "s = fl.Name". Why? Can anyone shed any light on this? Thanks Jul 28 '06 #1 Post Reply Share this Question 7 Replies P: n/a Janette For what it is worth, I have run this as both a stand alone vbscript and as an ASP page, and the only thing I changed was the path in the GetFolder command, and it worked fine for https://bytes.com/topic/asp-classic/answers/516963-object-required-error-using-filesystemobject both. Both for a folder that did and didn't have contents. My only suggestions, are double check that you have the path correct and check that you have appropriate permissions to the folder. Also it might be worth running this script as a vbscript ie take the code, put it in a file called xxxx.vbs, change response.write(s) to msgbox s, save and run it by double clicking. This may help identify if it is a permissions problem. Hope this helps Janette
(עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeLibraryLearnDownloadsRepositoryCommunityForumsBlog Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: https://social.technet.microsoft.com/Forums/scriptcenter/en-US/4a979e1a-423c-4603-a62b-8776980cf0c8/error-object-required-in-vbscript?forum=ITCG Error : Object required in vbscript Scripting > The Official Scripting Guys Forum! Question 0 Sign in to vote Hi, I am new to http://www.vbforums.com/showthread.php?291058-Error-424-object-required Vbscript. I have got an error :Object required when i tried to unintall the product using the Command line : setup.exe -silent -deinstall -nowait object required -responseFile"Oracle11g.rsp" Below is my code: Option Explicit Dim SRCDIR, FSO, strRespFile, strCmd, WshShell Set SRCDIR = CreateObject("Scripting.FileSystemObject").GetFile(WScript.ScriptFullName).ParentFolder Set strRespFile = TEMPDIR & "\Oracle11g.rsp" strCmd = """" & SRCDIR & "\Installer\setup.exe"" -silent -deinstall -nowait " & _ "-responseFile """ & strRespFile & """" WshShell.Run strCmd, 1, True If CheckError(SEVERE) vbscript runtime error Then LogMsg "Uninstallation will now abort.", SEVERE ExitScript(Err.Number) End If 'Wait for the Uninstallation process to complete LogEvent "Waiting for process to complete" Do While FindProcess("java.exe") WScript.Sleep(500) Loop LogMsg "Uninstallation process complete.", INFO Please help me. Thursday, July 21, 2011 3:55 PM Reply | Quote Answers 2 Sign in to vote We must not be seeing all of the VBScript code. And, the error message should have indicated a line number, which you can use to determine the line in the program that raised the error. The error might be raised because you are invoking the Run method of the wshShell object, but that object has not been Set. You appear to missing: Set wshShell = CreateObject("Wscript.Shell") However, we also seem to bemissing the code for the methods CheckError, LogMsg, ExitScript, LogEvent, and FindProcess. Are these defined elsewhere? Richard Mueller - MVP Directory S
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 that you want to visit from the selection below. Results 1 to 6 of 6 Thread: Error 424; object required Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch 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 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 || 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