Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Macro warning with no macros

On Aug 2, 3:22*pm, " wrote:
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.


After running your posted code, verify:

1. all the subs are gone
2. all the modules that contained the subs are gone
3. all worksheet code is gone
4. all workbook code is gone

The problem is probably in the 2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro warning with no macros

On Aug 2, 5:47*pm, James Ravenswood
wrote:
On Aug 2, 3:22*pm, " wrote:



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.


After running your posted code, verify:

1. all the subs are gone
2. all the modules that contained the subs are gone
3. all worksheet code is gone
4. all workbook code is gone

The problem is probably in the 2


Thanks for the suggestion. I had already checked all of those areas
and I don't see any code. There aren't any module files and there's
no visible code in either the worksheet or workbook.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Macro warning with no macros

On Aug 2, 6:58*pm, " wrote:
On Aug 2, 5:47*pm, James Ravenswood
wrote:





On Aug 2, 3:22*pm, " wrote:


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.


After running your posted code, verify:


1. all the subs are gone
2. all the modules that contained the subs are gone
3. all worksheet code is gone
4. all workbook code is gone


The problem is probably in the 2


Thanks for the suggestion. *I had already checked all of those areas
and I don't see any code. *There aren't any module files and there's
no visible code in either the worksheet or workbook.- Hide quoted text -

- Show quoted text -


If you don't receive a solution here, I suggest you repost your
question he

http://social.answers.microsoft.com/...ceprog/threads

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Macro warning with no macros

ActiveX controls embedded in the worksheet may give this warning.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/


On 8/2/2010 3:22 PM, wrote:
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.

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
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 03:15 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"