Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Saving workbook with a trusted extenstion VBA issue

Good afternoon,

I wonder if anyone could help me with this. I have a code that is exporting
several sheets from a workbook and saving them as a new workbook with a name
that the user specifies with in an input box.

It works perfectly, well almost. My problem is that when I try to open this
newly created workbook, I get the following warning:
"The file you are trying to open, "xxx.xls" is in a different format than
specified by the extension..... Do you want to open the file now?

It opens fine, and appears as if all the data is there, but I would really
like to get rid of this warning. The code used to save the file is:

ActiveWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & NewName & ".xls"
ActiveWorkbook.Close SaveChanges:=False
.ScreenUpdating = True

Is there a way that I can modify this code so that Excel "trusts" the
extension?

Thank you for any help

Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Saving workbook with a trusted extenstion VBA issue

Hi,

You should be able to mask the problem by using

Application.displayalerts=false
your code
application.displayalerts=true

But really it would be better to get to the bottom of the problem and it
sounds to me like an Excel version problem.

What vesrion of Excel are you using?
If it's 2007 then use the correct extension of .xlsx or .xlsm
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"PVANS" wrote:

Good afternoon,

I wonder if anyone could help me with this. I have a code that is exporting
several sheets from a workbook and saving them as a new workbook with a name
that the user specifies with in an input box.

It works perfectly, well almost. My problem is that when I try to open this
newly created workbook, I get the following warning:
"The file you are trying to open, "xxx.xls" is in a different format than
specified by the extension..... Do you want to open the file now?

It opens fine, and appears as if all the data is there, but I would really
like to get rid of this warning. The code used to save the file is:

ActiveWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & NewName & ".xls"
ActiveWorkbook.Close SaveChanges:=False
.ScreenUpdating = True

Is there a way that I can modify this code so that Excel "trusts" the
extension?

Thank you for any help

Paul

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Saving workbook with a trusted extenstion VBA issue

Hi Mike,

Thanks for the suggestion. I am using 2007 - and simply made it .xlsx and
the problem is gone which is brilliant.

Thanks again :)



"Mike H" wrote:

Hi,

You should be able to mask the problem by using

Application.displayalerts=false
your code
application.displayalerts=true

But really it would be better to get to the bottom of the problem and it
sounds to me like an Excel version problem.

What vesrion of Excel are you using?
If it's 2007 then use the correct extension of .xlsx or .xlsm
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"PVANS" wrote:

Good afternoon,

I wonder if anyone could help me with this. I have a code that is exporting
several sheets from a workbook and saving them as a new workbook with a name
that the user specifies with in an input box.

It works perfectly, well almost. My problem is that when I try to open this
newly created workbook, I get the following warning:
"The file you are trying to open, "xxx.xls" is in a different format than
specified by the extension..... Do you want to open the file now?

It opens fine, and appears as if all the data is there, but I would really
like to get rid of this warning. The code used to save the file is:

ActiveWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & NewName & ".xls"
ActiveWorkbook.Close SaveChanges:=False
.ScreenUpdating = True

Is there a way that I can modify this code so that Excel "trusts" the
extension?

Thank you for any help

Paul

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Saving workbook with a trusted extenstion VBA issue

Glad I could help
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"PVANS" wrote:

Hi Mike,

Thanks for the suggestion. I am using 2007 - and simply made it .xlsx and
the problem is gone which is brilliant.

Thanks again :)



"Mike H" wrote:

Hi,

You should be able to mask the problem by using

Application.displayalerts=false
your code
application.displayalerts=true

But really it would be better to get to the bottom of the problem and it
sounds to me like an Excel version problem.

What vesrion of Excel are you using?
If it's 2007 then use the correct extension of .xlsx or .xlsm
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"PVANS" wrote:

Good afternoon,

I wonder if anyone could help me with this. I have a code that is exporting
several sheets from a workbook and saving them as a new workbook with a name
that the user specifies with in an input box.

It works perfectly, well almost. My problem is that when I try to open this
newly created workbook, I get the following warning:
"The file you are trying to open, "xxx.xls" is in a different format than
specified by the extension..... Do you want to open the file now?

It opens fine, and appears as if all the data is there, but I would really
like to get rid of this warning. The code used to save the file is:

ActiveWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & NewName & ".xls"
ActiveWorkbook.Close SaveChanges:=False
.ScreenUpdating = True

Is there a way that I can modify this code so that Excel "trusts" the
extension?

Thank you for any help

Paul

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
Excel 2007 Saving Issue MartekMIS Excel Discussion (Misc queries) 1 April 19th 10 04:45 PM
Shared File Saving Issue Jared Excel Discussion (Misc queries) 0 July 23rd 09 09:08 PM
Issue saving file in excel 97 SR2 S. Zahid Excel Programming 0 January 11th 07 10:38 PM
See digital signature timestamp for workbook with trusted cert Ture Magnusson[_2_] Excel Programming 2 March 16th 05 02:34 PM
Saving a Workbook: Forcing User to Rename before Saving Rollin_Again[_6_] Excel Programming 5 April 16th 04 02:54 PM


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

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

About Us

"It's about Microsoft Excel"