Domanda

The following line in my VBA code is generating the compile error 'Compiler error expected: =' implying that it expected an assignment. What am I doing wrong and how do I fix this?

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

Workbooks(theFile).SaveAs("Z:\test\vhb\" & newName, xlCSV)
È stato utile?

Soluzione

You do not use parentheses unless you are assigning to a variable.

Workbooks(theFile).SaveAs "Z:\test\vhb\" & newName, xlCSV
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top