How to save an .xlsm file in vb.net 2005

Hi,
I have a code to create a .xls file and save it but it does not seem to work with .xlsm


 xlSecondapp = CreateObject("Excel.Application")
                     xlSecondapp.displayalerts = False
                     xlsecondwb = xlSecondapp.Workbooks.add
                     xlsecondws = xlsecondwb.Worksheets(1)
                     If RejectFile <> String.Empty Then
                        xlsecondwb.SaveAs(RejectFile)
                     Else
                     End If


Any suggestions are appreciated
RIASAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Arno KosterConnect With a Mentor Commented:
If so, and you are working with office 2007 or higher, try this :

xlsecondwb.SaveAs(RejectFile, 52)

Open in new window


(from : http://www.rondebruin.nl/saveas.htm)
0
 
Arno KosterCommented:
do you mean you cannot save the file when

Rejectfile = "filename.xlsm"

?
0
 
RIASAuthor Commented:
Cheers mate!!!works like charm!
0
 
Arno KosterCommented:
you're welcome !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.