Can you create a VB6 execuatable that just executes the code and doesn't go into a form?
Posted on 2006-06-20
We're running a scheduling program that executes excel files with Workbook_Open() macros to run the code such as that below. I'm constantly getting problems with plugins and references and want to re-write them in some sort of executable. My question is, can you just write a vb6 or .NET executable that doesn't bring up a form, or is this something I should us VBScript for (something I know very little about) or should I just create a batch file in DOS?? I'd like to use a VB product if possible since it pulls part of the file name from an Excel field.
Any ideas/recommendations would be appreciated.
Dim daterecord As String
'This step copies wmcerpt file
Workbooks.OpenText FileName:="T:\FFGCRPAC\AcctDownloads\WMCEREPT.txt" _
, Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier _
:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:= _
False, Comma:=True, Space:=False, Other:=False
daterecord = [A1].Value
Dim SourceFile1, DestinationFile1
SourceFile1 = "T:\FFGCRPAC\AcctDownloads\WMCEREPT.txt"
DestinationFile1 = "T:\FFGCRPAC\AcctDownloads\WMCEHistory\WMCEREPT" & daterecord & ".txt"
FileCopy SourceFile1, DestinationFile1