LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro warning with no macros

I know this question as been asked many times in the past and I have
searched for a fix for my situation but haven't found one that works.
Here's what's happening:

I have a workbook that does have lots of macros and is an XLSM file.
One of the macros copies one of the worksheets (doesn't have any
macros) to a new workbook. It then updates the data in the new
workbook and finally saves it using an "XLS" prefix. When I open the
new workbook I get the macro warning. I tried the following code
before the save to get rid of any macros in the new workbook and while
it does find 2 VBE component it doesn't get rid of the macro warning.

With ActiveWorkbook.VBProject
For i = .VBComponents.Count To 1 Step -1
.VBComponents(i).CodeModule.DeleteLines
1, .VBComponents(i).CodeModule.CountOfLines
Next i

For i = .VBComponents.Count To 1 Step -1
.VBComponents.Remove .VBComponents(i)
Next i
End With

Is there anything else I can do to get rid of the macro warning from
the new workbook? I know I could create a new workbook instead of
coping the sheet but I'd like to preserve all of the formatting,
headers and trailers without having to add setting them in the macro.

Thanks for your help.
 
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
Macro warning but no macros Peter Chandler Excel Programming 3 October 27th 06 05:08 AM
Macro warning...but no macros! slfarns Excel Programming 4 February 1st 06 04:22 AM
macro warning - but no macros GJR3599 Excel Discussion (Misc queries) 1 April 13th 05 08:15 PM
Still Macro Warning w/o Macros ... Joe HM Excel Programming 2 March 30th 05 05:01 PM
Macro warning when no macros Allison Excel Programming 8 October 22nd 04 11:26 PM


All times are GMT +1. The time now is 09:02 AM.

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"