PC Review


Reply
Thread Tools Rate Thread

Error saving Excel file in Visual Basic 2005

 
 
Speilman_54
Guest
Posts: n/a
 
      16th Apr 2007
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:\Complaint-
Files
\Active-EMC-Reports\EMC" _
& strdate & ".xls"),
Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal, "", _
"", 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create CHM file for Visual Basic 2005 Project =?Utf-8?B?dHZpbg==?= Microsoft Dot NET Framework 3 29th Oct 2007 01:36 AM
Excel Visual Basic error File already exists (Error 58) =?Utf-8?B?S2VsbGV5?= Microsoft Excel Crashes 4 16th May 2007 11:01 PM
Trying to open Excel From Visual Basic 2005 kylancal@gmail.com Microsoft Excel Worksheet Functions 1 22nd Mar 2007 04:44 AM
Can Visual Basic 2005 be used in Excel 2003? =?Utf-8?B?YXRlc29sdXRpb25z?= Microsoft Excel Programming 1 11th Jan 2006 02:47 PM
Visual Basic I/O error when opening Excel file =?Utf-8?B?U0sgTG93?= Microsoft Excel Worksheet Functions 0 24th Nov 2005 10:52 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:05 PM.