mrn
mrn

Reputation: 425

Save excel workbook with a user defined filename using VB.NET (What is wrong with this statement?)

VB.NET level:Beginner

On my interface user defines a name of the case in a textbox. I want to use this name as a filename for my excel workbook.

Is there any way to do this?

Following statement gives either no exception or error, but it is not doing what I want to do.

oWB.savecopyas("D:\"val(textbox1.text)".xlsx")

Thanks in advance

Upvotes: 0

Views: 1488

Answers (1)

Robert Beaubien
Robert Beaubien

Reputation: 3156

Try this:

oWB.savecopyas("D:\" & textbox1.text & ".xlsx")

Upvotes: 0

Related Questions