jeffcrtra
New Member
- Joined
- Oct 21, 2010
- Messages
- 10
Hey guys,
I've been dealing with this issue almost all day long. I created this macro enable excel file that when opens shows a calendar, the user choose the date, then shows the forecast spreadsheet, I inserted a export button on it, when the user clicks it, it makes a copy of the same file on xls format and request a preferred location, the problem that is somehow this new copy of the file contains the module and the calendar`s form inside; meaning when the end user open this new copy it request the date again when it should giving the fact it is an XLS file. Which makes no sense cause it is a single XLS file instead of a macro enable I'm using Excel 2007.
I will appreciate every reply and help on this topic.
Here's the code (only the module):
I've been dealing with this issue almost all day long. I created this macro enable excel file that when opens shows a calendar, the user choose the date, then shows the forecast spreadsheet, I inserted a export button on it, when the user clicks it, it makes a copy of the same file on xls format and request a preferred location, the problem that is somehow this new copy of the file contains the module and the calendar`s form inside; meaning when the end user open this new copy it request the date again when it should giving the fact it is an XLS file. Which makes no sense cause it is a single XLS file instead of a macro enable I'm using Excel 2007.
I will appreciate every reply and help on this topic.
Here's the code (only the module):
Code:
Sub export_xls()
'
'
Sheets("Purchase order").Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Prices table").Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Purchase order").Select
ActiveSheet.Shapes("Button 1").Select
Application.CutCopyMode = False
Selection.Delete
Custname = Sheets("Purchase order").Range("B4").Value & "-"
Cotdate = Sheets("Purchase order").Range("O3").Value
Application.DisplayAlerts = False
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
If .SelectedItems.Count > 0 Then
MsgBox .SelectedItems(1)
Application.DisplayAlerts = False
End If
End With
ActiveWorkbook.SaveAs Filename:="PurchaseOrder-" & Custname & Cotdate, FileFormat:=56
Application.DisplayAlerts = False
End Sub