Format.saveas Method "expected =" Error - Vba フォローする

0
Avatar
Legacy Poster

Weird bug I'm encountering when writing VBA code in Excel... every time I try to use Format.SaveAs method using the syntax from the documentation available online, VBA editor is giving me a compile error "Expected: = ".

 

Is the syntax different for VBA? The documentation I was looking at was for VB.NET, but IntelliSense is suggesting the same syntax I'm using when I'm typing it... Anyone else encounter this issue?

2 コメント

0
Avatar
Shotaro Ito
モデレータ
コメントアクション Permalink

VBA requires "Call" when you have two or more arguments in brackets for a procedure.

 

Try Call btFormat.SaveAs(strPath, True)

0
Avatar
Legacy Poster
コメントアクション Permalink

Aha! Thank you Shotaro. I had a feeling it was something simple I was overlooking (as is the case with ~75% of problems I encounter). I knew about "Call" using standalone methods, but I wasn't aware it was required for class level procedures as well.

ログインしてコメントを残してください。