bigbillybob
Technical User
i volunteered to write a script at work and it works on my test environment but on 2008 r2 server doesn't work.
i get a "cannot use parentheses when call a sub error"
i looked at other solutions and tried to implement them by removing the ones in question but still a no go.
any help would be greatly appreciated.
i get a "cannot use parentheses when call a sub error"
i looked at other solutions and tried to implement them by removing the ones in question but still a no go.
Code:
Module Module1
Sub Main()
Dim app, objworkbook
app = CreateObject("Excel.Application")
app.Visible = True
With app
.workbooks.Open("c:\test\macros.xlsm") ' the file with macro
.Visible = True
.workbooks.OpenText("C:\test\test.txt", _
, , , , , , , , , True, "~") ' file that needs to be updated
.Visible = True
End With
objworkbook = app.Workbooks.OpenText("C:\test\test.txt")
app.Run("'macros.xlsm'!rowcount")
With app
.ActiveWorkbook.SaveAs(("c:\testsave\Test_" & Year(Now) & "-" & Month(Now) & "-" & Day(Now) & ".txt"))
.ActiveWorkbook.Close(True)
.Quit()
End With
End Sub
End Module
any help would be greatly appreciated.