BritsBlitz
New Member
- Joined
- Jan 10, 2014
- Messages
- 34
- Office Version
- 365
- Platform
- Windows
I have aVBA code that works great for Windows, but need to change it for MacOS. The code creates a .txt file and writes the content from an intake form to the file. I use the following vba code to create the file and write the content to the file:
'Create the text file
Set TxtFile = CreateObject("Scripting.FileSystemObject")
Set OutTxt = TxtFile.CreateTextFile("C:\Feedback.txt", True, True)
'Write to the text file
OutTxt.Write ComboBox1.Value & ","
OutTxt.Write ComboBox2.Value & ","
OutTxt.Write ComboBox3.Value & ","
OutTxt.Close
CreateObject does not work with MacOS. Is there an alternative to CreateObject for MacOS that I can use the achieve the same as the lines above?
'Create the text file
Set TxtFile = CreateObject("Scripting.FileSystemObject")
Set OutTxt = TxtFile.CreateTextFile("C:\Feedback.txt", True, True)
'Write to the text file
OutTxt.Write ComboBox1.Value & ","
OutTxt.Write ComboBox2.Value & ","
OutTxt.Write ComboBox3.Value & ","
OutTxt.Close
CreateObject does not work with MacOS. Is there an alternative to CreateObject for MacOS that I can use the achieve the same as the lines above?