By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,397 Members | 2,515 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,397 IT Pros & Developers. It's quick & easy.

Error saving Excel file in Visual Basic 2005

P: n/a
Hi,
I'm converting an excel Macro into visual basic 2005 express, as I
don't have a copy of VB 6 and trying to make and executable from it,
I know this version doesn't have the save file as .exe, but I have a
3rd party software that will convert vb projects into .exe files. My
issue is in the the saving of the excel file. The macro bassicly
imports a tab delimeted file and manipulates the file and then saves
it, as a template to work from. I'm recieving COMexeption errors on
saving the file. Here is what I have for the save portion.

m_XLApp.Application.ActiveWorkbook.SaveAs(("Z:\Com plaint-
Files
\Active-EMC-Reports\EMC" _
& strdate & ".xls"),
Microsoft.Office.Interop.Excel.XlFileFormat.xlWork bookNormal, "", _
"", False, False,
Microsoft.Office.Interop.Excel.XlSaveAsAccessMode. xlNoChange, , , , , )
This is the error that I recieve.
System.Runtime.InteropServices.COMException was unhandled
ErrorCode=-2146827284
HelpLink="C:\Program Files\Microsoft Office
\OFFICE11\1033\xlmain11.chm"
Message="The file could not be accessed. Try one of the following:
I'm not sure if I'm using improper syntax or just missing something.
Any help would greatly appreciated

Apr 16 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.