I'm struggling with writing to a VBS file I'm creating
This works
how do I write the code below, below the line .vary = "we made it" in the code above into the vbs file?
it is the two "set" lines and the xl.run line I'm struggling with.
if only this can be solved
thank you in advance
smiler44
This works
Code:
Dim fso As FileSystemObject
Dim stream As TextStream
Dim vary As String ' a variable
Set fso = New FileSystemObject
Set stream = fso.CreateTextFile("c:\directorypath\test.vbs", True)
vary = "we made it"
stream.WriteLine vary
how do I write the code below, below the line .vary = "we made it" in the code above into the vbs file?
it is the two "set" lines and the xl.run line I'm struggling with.
Code:
Set xl = CreateObject("Excel.Application")
Set wb = xl.Workbooks.Open("C:\Users\home\documents\planning escalations\book1.xlsm")
xl.Run "'book1.xlsm'!macro1"
wb.Close ' this line I can write
xl.Quit ' this line I can write
if only this can be solved
thank you in advance
smiler44