ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   File save as produces corrupt file (https://www.excelbanter.com/excel-programming/430905-file-save-produces-corrupt-file.html)

XP

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.


Dave Peterson

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

XP

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


XP

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


Ron de Bruin

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


XP

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




All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com