Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Quotes and strings. Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
RichardL
Senior Member
Senior Member


Joined: December 29 2008
Location: United States
Online Status: Offline
Posts: 165
Posted: March 11 2010 at 22:18 | IP Logged Quote RichardL

OK, I'm in quote hell tonight. I've an trying to archive my event log and trim it via a nightly VBS routine.


This works:

rv = PH.Formula("PH_ExportEventLog(PH_RelativeDateTime(Today(), -1440), PH_RelativeDateTime(Today(), 0), 0, ""C:\Program Files\Powerhome\Logs\EL1.XLS"", 1, 0)")


This does not Work:

strEventLogFileName = "C:\Program Files\PowerHome\Logs\EventLog_" & Year(Now) & Right("0" & Month(Now), 2) & Right("0" & Day(Now), 2) & ".Log"

rv = PH.Formula("PH_ExportEventLog(PH_RelativeDateTime(Today(), -1440), PH_RelativeDateTime(Today(), 0), 0, strEventLogFileName, 1, 0)")


I've tried many many combinations, nothing works, except hardcoding the filename, which I do not want to do, since I want the date embedded in the filename. I could always run it hardcoded then do a rename, but that not really nice...

Any help is appreciated!

Thanks,

Richard
Back to Top View RichardL's Profile Search for other posts by RichardL
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: March 11 2010 at 22:26 | IP Logged Quote dhoward

I havent tested it, but give this a try:
Code:

rv = PH.Formula("PH_ExportEventLog(PH_RelativeDateTime(Today(), -1440), PH_RelativeDateTime(Today(), 0), 0,""" + strEventLogFileName + """, 1, 0)")


Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
RichardL
Senior Member
Senior Member


Joined: December 29 2008
Location: United States
Online Status: Offline
Posts: 165
Posted: March 11 2010 at 22:41 | IP Logged Quote RichardL

Works!!!

So I got curious.
A variation also works:

rv = PH.Formula("PH_ExportEventLog(PH_RelativeDateTime(Today(), -1440), PH_RelativeDateTime(Today(), 0), 0,""" & strEventLogFileName & """, 1, 0)")


This does not Work:

strEventLogFileName = "C:\Program Files\PowerHome\Logs\EventLog_" & Year(Now) & Right("0" & Month(Now), 2) & Right("0" & Day(Now), 2) & ".Log"

strEventLogFileName = Chr(34) & Chr(34) & Chr(34) & strEventLogFileName & Chr(34) & Chr(34) & Chr(34)

rv = PH.Formula("PH_ExportEventLog(PH_RelativeDateTime(Today(), -1440), PH_RelativeDateTime(Today(), 0), 0, strEventLogFileName, 1, 0)")


Thanks for saving the day!

Richard
Back to Top View RichardL's Profile Search for other posts by RichardL
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum