问题描述:

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:)

网友答案:

Double-up the "...like this:

MyFile.WriteLine("Set fso = CreateObject(""Scripting.FileSystemObject"")")
相关阅读:
Top