Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
TOM TOM is offline
external usenet poster
 
Posts: 47
Default how to delete all macros - save file with cell-name

Hi,

Is it possible to make a macro that deletes all macro's?
I've got a large xls file (7MB) and I want to save only
the fill-in cells.
I've made a macro that copies the fill-in cells to a
sheet and deletes all the others sheets.
I use an auto_open macro and after deleting the sheets
the auto_open macro cannot be played, so I have te delete
it.

Second question : How can I save a file with the value
(name) of a cell ?
ex : A1 = TOM
I want to make a marco that saves the file as:
Version 1.0 TOM

Greez
Tom
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default how to delete all macros - save file with cell-name

Hi Tom
Sub DeleteAllMacros()
Dim Composantvbe As Object
With ActiveWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

To save your file with value in A1:
Activeworkbook.SaveAs "Version 1.0" &
Worksheets("YourSheet").Range("A1").Value & ".xls"

HTH
Cordially
Pascal


"Tom" a écrit dans le message de
...
Hi,

Is it possible to make a macro that deletes all macro's?
I've got a large xls file (7MB) and I want to save only
the fill-in cells.
I've made a macro that copies the fill-in cells to a
sheet and deletes all the others sheets.
I use an auto_open macro and after deleting the sheets
the auto_open macro cannot be played, so I have te delete
it.

Second question : How can I save a file with the value
(name) of a cell ?
ex : A1 = TOM
I want to make a marco that saves the file as:
Version 1.0 TOM

Greez
Tom



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default how to delete all macros - save file with cell-name

Perfect !

Can I open an xls file which name I don't know.
So I want to make a macro that opens an xls file that
will be selected by the user(browse) and than I want to
copy a sheet of this file.

Greez
Tom

-----Original Message-----
Hi Tom
Sub DeleteAllMacros()
Dim Composantvbe As Object
With ActiveWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

To save your file with value in A1:
Activeworkbook.SaveAs "Version 1.0" &
Worksheets("YourSheet").Range("A1").Value & ".xls"

HTH
Cordially
Pascal


"Tom" a écrit dans

le message de
...
Hi,

Is it possible to make a macro that deletes all

macro's?
I've got a large xls file (7MB) and I want to save only
the fill-in cells.
I've made a macro that copies the fill-in cells to a
sheet and deletes all the others sheets.
I use an auto_open macro and after deleting the sheets
the auto_open macro cannot be played, so I have te

delete
it.

Second question : How can I save a file with the value
(name) of a cell ?
ex : A1 = TOM
I want to make a marco that saves the file as:
Version 1.0 TOM

Greez
Tom



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default how to delete all macros - save file with cell-name

The macro DeleteAllMacros doesn't work.
Message : Methiode VBPtoject of object_workbook has
failed.

And the line : With ActiveWorkbook.VBProject is colored
yellow.
What can I do ?
Tom
-----Original Message-----
Perfect !

Can I open an xls file which name I don't know.
So I want to make a macro that opens an xls file that
will be selected by the user(browse) and than I want to
copy a sheet of this file.

Greez
Tom

-----Original Message-----
Hi Tom
Sub DeleteAllMacros()
Dim Composantvbe As Object
With ActiveWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

To save your file with value in A1:
Activeworkbook.SaveAs "Version 1.0" &
Worksheets("YourSheet").Range("A1").Value & ".xls"

HTH
Cordially
Pascal


"Tom" a écrit

dans
le message de
.. .
Hi,

Is it possible to make a macro that deletes all

macro's?
I've got a large xls file (7MB) and I want to save

only
the fill-in cells.
I've made a macro that copies the fill-in cells to a
sheet and deletes all the others sheets.
I use an auto_open macro and after deleting the sheets
the auto_open macro cannot be played, so I have te

delete
it.

Second question : How can I save a file with the value
(name) of a cell ?
ex : A1 = TOM
I want to make a marco that saves the file as:
Version 1.0 TOM

Greez
Tom



.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default how to delete all macros - save file with cell-name

Tom
Sub OpenFile()
Filename = Application.Dialogs(xlDialogOpen).Show
If Filename < False Then
On Error Resume Next
Workbooks(ActiveWorkbook.Name).Sheets("YourSheet") .Copy
If Err < 0 Then MsgBox "The active workbook has no sheet named " &
"YourSheet"
Else: MsgBox "Opening operation has been cancelled", vbInformation
End If
End Sub

HTH
Cordially
Pascal
a écrit dans le message de
...
Perfect !

Can I open an xls file which name I don't know.
So I want to make a macro that opens an xls file that
will be selected by the user(browse) and than I want to
copy a sheet of this file.

Greez
Tom

-----Original Message-----
Hi Tom
Sub DeleteAllMacros()
Dim Composantvbe As Object
With ActiveWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

To save your file with value in A1:
Activeworkbook.SaveAs "Version 1.0" &
Worksheets("YourSheet").Range("A1").Value & ".xls"

HTH
Cordially
Pascal


"Tom" a écrit dans

le message de
...
Hi,

Is it possible to make a macro that deletes all

macro's?
I've got a large xls file (7MB) and I want to save only
the fill-in cells.
I've made a macro that copies the fill-in cells to a
sheet and deletes all the others sheets.
I use an auto_open macro and after deleting the sheets
the auto_open macro cannot be played, so I have te

delete
it.

Second question : How can I save a file with the value
(name) of a cell ?
ex : A1 = TOM
I want to make a marco that saves the file as:
Version 1.0 TOM

Greez
Tom



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default how to delete all macros - save file with cell-name

Tom
Does the active workbook contain your macros?
If not you may change with ThisWorkbook

HTH
Cordially
Pascal

a écrit dans le message de
...
The macro DeleteAllMacros doesn't work.
Message : Methiode VBPtoject of object_workbook has
failed.

And the line : With ActiveWorkbook.VBProject is colored
yellow.
What can I do ?
Tom
-----Original Message-----
Perfect !

Can I open an xls file which name I don't know.
So I want to make a macro that opens an xls file that
will be selected by the user(browse) and than I want to
copy a sheet of this file.

Greez
Tom

-----Original Message-----
Hi Tom
Sub DeleteAllMacros()
Dim Composantvbe As Object
With ActiveWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

To save your file with value in A1:
Activeworkbook.SaveAs "Version 1.0" &
Worksheets("YourSheet").Range("A1").Value & ".xls"

HTH
Cordially
Pascal


"Tom" a écrit

dans
le message de
.. .
Hi,

Is it possible to make a macro that deletes all

macro's?
I've got a large xls file (7MB) and I want to save

only
the fill-in cells.
I've made a macro that copies the fill-in cells to a
sheet and deletes all the others sheets.
I use an auto_open macro and after deleting the sheets
the auto_open macro cannot be played, so I have te

delete
it.

Second question : How can I save a file with the value
(name) of a cell ?
ex : A1 = TOM
I want to make a marco that saves the file as:
Version 1.0 TOM

Greez
Tom



.

.



  #7   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default how to delete all macros - save file with cell-name

Pascal,

I have changed ActiveWorkbook into This Workbook but it
doesnt 't work yet.
This is the current macro :

Sub DeleteAllMacros()
Dim Composantvbe As Object
With ThisWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

PS : I have only one XLS file open


The Macro "openfile" doens't work eather.
Message : The Variable "Filename" is not defined.
I can use this macro :

Workbooks.Open(Filename:="C:\Export Quogen NeXspan
1.0.xls").RunAutoMacros _
Which:=xlAutoOpen

But the problem here is that the file must be named as :
Export Quogen NeXspan 1.0.xls
I want that the user (not me) can select himself an XLS
file (by browse) because the file won't be saved
as "Export Quogen NeXspan 1.0.xls" by the user.
I don't know the name that the other user wil use to save
the file

Tom

PS : I'm working in Office 2003.



-----Original Message-----
Tom
Does the active workbook contain your macros?
If not you may change with ThisWorkbook

HTH
Cordially
Pascal

a écrit dans le

message de
...
The macro DeleteAllMacros doesn't work.
Message : Methiode VBPtoject of object_workbook has
failed.

And the line : With ActiveWorkbook.VBProject is colored
yellow.
What can I do ?
Tom
-----Original Message-----
Perfect !

Can I open an xls file which name I don't know.
So I want to make a macro that opens an xls file that
will be selected by the user(browse) and than I want to
copy a sheet of this file.

Greez
Tom

-----Original Message-----
Hi Tom
Sub DeleteAllMacros()
Dim Composantvbe As Object
With ActiveWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

To save your file with value in A1:
Activeworkbook.SaveAs "Version 1.0" &
Worksheets("YourSheet").Range("A1").Value & ".xls"

HTH
Cordially
Pascal


"Tom" a écrit

dans
le message de
. ..
Hi,

Is it possible to make a macro that deletes all

macro's?
I've got a large xls file (7MB) and I want to save

only
the fill-in cells.
I've made a macro that copies the fill-in cells to a
sheet and deletes all the others sheets.
I use an auto_open macro and after deleting the

sheets
the auto_open macro cannot be played, so I have te

delete
it.

Second question : How can I save a file with the

value
(name) of a cell ?
ex : A1 = TOM
I want to make a marco that saves the file as:
Version 1.0 TOM

Greez
Tom


.

.



.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default how to delete all macros - save file with cell-name

Tom
I am also using Excel 2003 and the delete macros routine works fine so there
may be some other issue I honestly cannot see, unless you are executing the
code directly from the VBE which could be the reason?
Please also bear in mind that you won't be able to undo the deletion of
code.
This means that you should perhaps save your workbook before deleting and
save with a different name once macros are deleted.
As regards FileName just add a:
Dim FileName

Hope this helps
Cordially
Pascal

a écrit dans le message de
...
Pascal,

I have changed ActiveWorkbook into This Workbook but it
doesnt 't work yet.
This is the current macro :

Sub DeleteAllMacros()
Dim Composantvbe As Object
With ThisWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

PS : I have only one XLS file open


The Macro "openfile" doens't work eather.
Message : The Variable "Filename" is not defined.
I can use this macro :

Workbooks.Open(Filename:="C:\Export Quogen NeXspan
1.0.xls").RunAutoMacros _
Which:=xlAutoOpen

But the problem here is that the file must be named as :
Export Quogen NeXspan 1.0.xls
I want that the user (not me) can select himself an XLS
file (by browse) because the file won't be saved
as "Export Quogen NeXspan 1.0.xls" by the user.
I don't know the name that the other user wil use to save
the file

Tom

PS : I'm working in Office 2003.



-----Original Message-----
Tom
Does the active workbook contain your macros?
If not you may change with ThisWorkbook

HTH
Cordially
Pascal

a écrit dans le

message de
...
The macro DeleteAllMacros doesn't work.
Message : Methiode VBPtoject of object_workbook has
failed.

And the line : With ActiveWorkbook.VBProject is colored
yellow.
What can I do ?
Tom
-----Original Message-----
Perfect !

Can I open an xls file which name I don't know.
So I want to make a macro that opens an xls file that
will be selected by the user(browse) and than I want to
copy a sheet of this file.

Greez
Tom

-----Original Message-----
Hi Tom
Sub DeleteAllMacros()
Dim Composantvbe As Object
With ActiveWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

To save your file with value in A1:
Activeworkbook.SaveAs "Version 1.0" &
Worksheets("YourSheet").Range("A1").Value & ".xls"

HTH
Cordially
Pascal


"Tom" a écrit

dans
le message de
. ..
Hi,

Is it possible to make a macro that deletes all

macro's?
I've got a large xls file (7MB) and I want to save

only
the fill-in cells.
I've made a macro that copies the fill-in cells to a
sheet and deletes all the others sheets.
I use an auto_open macro and after deleting the

sheets
the auto_open macro cannot be played, so I have te

delete
it.

Second question : How can I save a file with the

value
(name) of a cell ?
ex : A1 = TOM
I want to make a marco that saves the file as:
Version 1.0 TOM

Greez
Tom


.

.



.



  #9   Report Post  
Posted to microsoft.public.excel.programming
TOM TOM is offline
external usenet poster
 
Posts: 47
Default how to delete all macros - save file with cell-name

Pascal,

Openfile works great !
Deleteallmarcros doenst't work but I have found another
solution.
I've copied te worksheet to a new map and than saved it
as the name of cell A2 like you told me.

Thank you very much for your support!
Tom
-----Original Message-----
Tom
I am also using Excel 2003 and the delete macros routine

works fine so there
may be some other issue I honestly cannot see, unless

you are executing the
code directly from the VBE which could be the reason?
Please also bear in mind that you won't be able to undo

the deletion of
code.
This means that you should perhaps save your workbook

before deleting and
save with a different name once macros are deleted.
As regards FileName just add a:
Dim FileName

Hope this helps
Cordially
Pascal

a écrit dans le

message de
...
Pascal,

I have changed ActiveWorkbook into This Workbook but it
doesnt 't work yet.
This is the current macro :

Sub DeleteAllMacros()
Dim Composantvbe As Object
With ThisWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

PS : I have only one XLS file open


The Macro "openfile" doens't work eather.
Message : The Variable "Filename" is not defined.
I can use this macro :

Workbooks.Open(Filename:="C:\Export Quogen NeXspan
1.0.xls").RunAutoMacros _
Which:=xlAutoOpen

But the problem here is that the file must be named as :
Export Quogen NeXspan 1.0.xls
I want that the user (not me) can select himself an XLS
file (by browse) because the file won't be saved
as "Export Quogen NeXspan 1.0.xls" by the user.
I don't know the name that the other user wil use to save
the file

Tom

PS : I'm working in Office 2003.



-----Original Message-----
Tom
Does the active workbook contain your macros?
If not you may change with ThisWorkbook

HTH
Cordially
Pascal

a écrit dans le

message de
.. .
The macro DeleteAllMacros doesn't work.
Message : Methiode VBPtoject of object_workbook has
failed.

And the line : With ActiveWorkbook.VBProject is colored
yellow.
What can I do ?
Tom
-----Original Message-----
Perfect !

Can I open an xls file which name I don't know.
So I want to make a macro that opens an xls file that
will be selected by the user(browse) and than I want to
copy a sheet of this file.

Greez
Tom

-----Original Message-----
Hi Tom
Sub DeleteAllMacros()
Dim Composantvbe As Object
With ActiveWorkbook.VBProject
For Each Composantvbe In .VBComponents
If Composantvbe.Type = 100 Then
With Composantvbe.CodeModule
.DeleteLines 1, .CountOfLines
.CodePane.Window.Close
End With
Else: .VBComponents.Remove Composantvbe
End If
Next Composantvbe
End With
End Sub

To save your file with value in A1:
Activeworkbook.SaveAs "Version 1.0" &
Worksheets("YourSheet").Range("A1").Value & ".xls"

HTH
Cordially
Pascal


"Tom" a écrit

dans
le message de
.. .
Hi,

Is it possible to make a macro that deletes all
macro's?
I've got a large xls file (7MB) and I want to save

only
the fill-in cells.
I've made a macro that copies the fill-in cells to a
sheet and deletes all the others sheets.
I use an auto_open macro and after deleting the

sheets
the auto_open macro cannot be played, so I have te
delete
it.

Second question : How can I save a file with the

value
(name) of a cell ?
ex : A1 = TOM
I want to make a marco that saves the file as:
Version 1.0 TOM

Greez
Tom


.

.



.



.

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
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Macros Containing a File Save As & Tab Deletions Mike The Newb Excel Discussion (Misc queries) 4 August 16th 06 12:43 PM
save excel file from a table delimited file (.txt) using macros sedamfo New Users to Excel 1 February 15th 05 04:19 AM
Delete rows in Excel file with macros Krassimir Excel Programming 0 October 1st 03 01:04 PM
Macros in Excel - Save as and rename file Bob Phillips[_5_] Excel Programming 0 August 13th 03 09:28 AM


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

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"