Vba 'Compiler Error: =' on saveAs

The next line in my VBA code generates a compilation error. Compiler error: = 'implies that it is awaiting assignment. What am I doing wrong and how to fix it?

I just want to save the file. In addition, I want to overwrite a file that was previously a .xls or .xlsx file. Will this line do this?

Workbooks(theFile).SaveAs("Z:\test\vhb\" & newName, xlCSV) 
+4
source share
1 answer

You do not use parentheses unless you assign a variable.

 Workbooks(theFile).SaveAs "Z:\test\vhb\" & newName, xlCSV 
+15
source

Source: https://habr.com/ru/post/1395797/


All Articles