1

Probably an easy question for most of you in here, but I cannot seem to get it right.

How do I make this line of code work?

MyFile.WriteLine("Set fso = CreateObject("Scripting.FileSystemObject")")

I understand why I get the error with ')' expected, but I just don´t know how to get around it.

The (" and ") wrapping the string Scripting.FileSystemObject is causing the problem.

In other words, I need to WriteLine EXACTLY the following:

Set fso = CreateObject("Scripting.FileSystemObject")

Thank you in advance:)

tnuis
  • 121
  • 2
  • 4
  • 8

1 Answers1

2

Double-up the "...like this:

MyFile.WriteLine("Set fso = CreateObject(""Scripting.FileSystemObject"")")
aphoria
  • 19,796
  • 7
  • 64
  • 73