471,870 Members | 1,505 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,870 software developers and data experts.

Error saving Excel file in Visual Basic 2005

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
0 1891

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Allison Bailey | last post: by
4 posts views Thread by Michael Kennedy [UB] | last post: by
1 post views Thread by Arjun Diwan | last post: by
6 posts views Thread by Peter Frost | last post: by
4 posts views Thread by mcwooq | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.