Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default File save as produces corrupt file


Using XL2007.

In code I open a text file (csv) and format it as I want it, then the
program saves the file using: ActiveWorkbook.SaveAs MyFullFileName

All runs fine. But, when I try to open the file, I get an error that says
the file is corrupt or has an unrecognizable file extension...what the?

This is using code I've used for years in 2003 without problem.

Any help would be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default File save as produces corrupt file

Specify the extension in that filename and make sure you include the
fileformat:= parm in the .saveas line.

And they have to be consistent, too!

xp wrote:

Using XL2007.

In code I open a text file (csv) and format it as I want it, then the
program saves the file using: ActiveWorkbook.SaveAs MyFullFileName

All runs fine. But, when I try to open the file, I get an error that says
the file is corrupt or has an unrecognizable file extension...what the?

This is using code I've used for years in 2003 without problem.

Any help would be appreciated.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default File save as produces corrupt file


I do specify a file format so that is not the issue; however, "fileformat" is
a new spec to me, I will check that out and see if it does the trick...

Thanks Dave.

"Dave Peterson" wrote:

Specify the extension in that filename and make sure you include the
fileformat:= parm in the .saveas line.

And they have to be consistent, too!

xp wrote:

Using XL2007.

In code I open a text file (csv) and format it as I want it, then the
program saves the file using: ActiveWorkbook.SaveAs MyFullFileName

All runs fine. But, when I try to open the file, I get an error that says
the file is corrupt or has an unrecognizable file extension...what the?

This is using code I've used for years in 2003 without problem.

Any help would be appreciated.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default File save as produces corrupt file

Dave,

FYI, you were right, the "FileFormat" spec is required now in order for this
command to work correctly (at least in my case); thanks!


"Dave Peterson" wrote:

Specify the extension in that filename and make sure you include the
fileformat:= parm in the .saveas line.

And they have to be consistent, too!

xp wrote:

Using XL2007.

In code I open a text file (csv) and format it as I want it, then the
program saves the file using: ActiveWorkbook.SaveAs MyFullFileName

All runs fine. But, when I try to open the file, I get an error that says
the file is corrupt or has an unrecognizable file extension...what the?

This is using code I've used for years in 2003 without problem.

Any help would be appreciated.


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default File save as produces corrupt file

See also this page for more info
http://www.rondebruin.nl/saveas.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"xp" wrote in message ...
Dave,

FYI, you were right, the "FileFormat" spec is required now in order for this
command to work correctly (at least in my case); thanks!


"Dave Peterson" wrote:

Specify the extension in that filename and make sure you include the
fileformat:= parm in the .saveas line.

And they have to be consistent, too!

xp wrote:

Using XL2007.

In code I open a text file (csv) and format it as I want it, then the
program saves the file using: ActiveWorkbook.SaveAs MyFullFileName

All runs fine. But, when I try to open the file, I get an error that says
the file is corrupt or has an unrecognizable file extension...what the?

This is using code I've used for years in 2003 without problem.

Any help would be appreciated.


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default File save as produces corrupt file



Great explanations, thanks Ron!

"Ron de Bruin" wrote:

See also this page for more info
http://www.rondebruin.nl/saveas.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"xp" wrote in message ...
Dave,

FYI, you were right, the "FileFormat" spec is required now in order for this
command to work correctly (at least in my case); thanks!


"Dave Peterson" wrote:

Specify the extension in that filename and make sure you include the
fileformat:= parm in the .saveas line.

And they have to be consistent, too!

xp wrote:

Using XL2007.

In code I open a text file (csv) and format it as I want it, then the
program saves the file using: ActiveWorkbook.SaveAs MyFullFileName

All runs fine. But, when I try to open the file, I get an error that says
the file is corrupt or has an unrecognizable file extension...what the?

This is using code I've used for years in 2003 without problem.

Any help would be appreciated.

--

Dave Peterson


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Corrupt file tjb014 Excel Discussion (Misc queries) 2 June 17th 09 12:48 AM
Corrupt file CC Excel Discussion (Misc queries) 1 November 14th 08 10:38 AM
Formula produces picture file...? miwarren Excel Worksheet Functions 2 December 28th 05 03:59 PM
Corrupt file, please help ?? Jeff Excel Programming 2 May 24th 05 05:10 AM
Corrupt File German[_2_] Excel Programming 2 January 31st 04 12:34 AM


All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"