Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
nuti
 
Posts: n/a
Default error while compiling "OBJECT REQUIRED"

hi,

iam trying to run a macro in the excel but its throwing error "object
required".
kindly help me out .

THE ERROR IS SHOWN FOR THE LAST LINE OF CODE.

-------------------------------------------------------------------------------------------------------
Dim objWSH As String, objFileSystem, objlogfile As String
Dim strWorkPath, lCountErrors, lCountWarnings, strLogFileName,
strLogDate As String
Dim strDHCPServer, strIPAddr, strMACAddr, strScope, strClientName,
strComment, strtype As String
Dim strOption, strOptionCode, strOptionValue, strDNSvalues As String
Dim fso, DHCPInputFile, strLine, varLine, posFirstParam, strFirstParam
As String
Dim strNewLine, posSecondParam, strSecondParam, strThirdParam As String
Dim strInputboxText, intInput, strInputFile, strRegion, strMsgboxText,
intMsgbox As String


Set objWSH = WScript.CreateObject("Wscript.shell")
Set objFileSystem = WScript.CreateObject("Scripting.FileSystemObject")

strWorkPath = objFileSystem.GetParentFolderName(WScript.ScriptFu llName)
'Set working directory


'Logfile configuration
strLogDate = GetLogDate
strLogFileName = objWSH.ExpandEnvironmentStrings(strWorkPath & "\" &
strLogDate & ".log")
Set objlogfile = objFileSystem.CreateTextFile(strLogFileName, True)



-------------------------------------------------------------------------------------------------------

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default error while compiling "OBJECT REQUIRED"

You declared:
objlogfile As String
how about:
objlogfile As Object



nuti wrote:

hi,

iam trying to run a macro in the excel but its throwing error "object
required".
kindly help me out .

THE ERROR IS SHOWN FOR THE LAST LINE OF CODE.

-------------------------------------------------------------------------------------------------------
Dim objWSH As String, objFileSystem, objlogfile As String
Dim strWorkPath, lCountErrors, lCountWarnings, strLogFileName,
strLogDate As String
Dim strDHCPServer, strIPAddr, strMACAddr, strScope, strClientName,
strComment, strtype As String
Dim strOption, strOptionCode, strOptionValue, strDNSvalues As String
Dim fso, DHCPInputFile, strLine, varLine, posFirstParam, strFirstParam
As String
Dim strNewLine, posSecondParam, strSecondParam, strThirdParam As String
Dim strInputboxText, intInput, strInputFile, strRegion, strMsgboxText,
intMsgbox As String

Set objWSH = WScript.CreateObject("Wscript.shell")
Set objFileSystem = WScript.CreateObject("Scripting.FileSystemObject")

strWorkPath = objFileSystem.GetParentFolderName(WScript.ScriptFu llName)
'Set working directory

'Logfile configuration
strLogDate = GetLogDate
strLogFileName = objWSH.ExpandEnvironmentStrings(strWorkPath & "\" &
strLogDate & ".log")
Set objlogfile = objFileSystem.CreateTextFile(strLogFileName, True)

-------------------------------------------------------------------------------------------------------


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"