From: Helmut on
Bob,
The following did finally work:

' Save File as "xlsm" in new location

Do
fName = Application.GetSaveAsFilename(InitialFileName:=Myvalue,
filefilter:= _
" Excel Macro Enabled Workbook (*.xlsm), *.xlsm,")
Loop Until fName <> False

ActiveWorkbook.SaveAs Filename:=fName,
FileFormat:=xlOpenXMLWorkbookMacroEnabled

Thanks for your help anyhow.

"Bob Phillips" wrote:

> This is odd Helmut. I have just tried your code and it works fine for me, I
> didn't even need the FileFormat property, so there must be something else in
> your code.
>
> HTH
>
> Bob
>
> "Helmut" <Helmut(a)discussions.microsoft.com> wrote in message
> news:43C89CC1-746F-42BB-B0A3-FD18B58DA53F(a)microsoft.com...
> > Bob,
> > I get "Run-time error '1004' - Method 'SaveAs' of 'object '_Workbook'
> > failed."
> > Helmut
> >
> > "Bob Phillips" wrote:
> >
> >> Did you try adding FileFormat:= xlOpenXMLWorkbookMacroEnabled to the save
> >> statement?
> >>
> >> HTH
> >>
> >> Bob
> >>
> >> "Helmut" <Helmut(a)discussions.microsoft.com> wrote in message
> >> news:A7800D7D-0321-4535-A708-A2519A13753B(a)microsoft.com...
> >> >I have the following code within an "xltm" file which I want to then
> >> >save
> >> >as
> >> > "xlsm":
> >> >
> >> > Do
> >> > fName = Application.GetSaveAsFilename(InitialFileName:="kupa",
> >> > filefilter:= _
> >> > " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,")
> >> > Loop Until fName <> False
> >> > ActiveWorkbook.SaveAs Filename:=fName
> >> >
> >> > I get ERROR on last statement. How can I add "FileFormatValue = 52" to
> >> > save
> >> > the file as a "MacroEnabled"
> >> > thanks
> >>
> >>
> >> .
> >>
>
>
> .
>
From: Bob Phillips on
I suggested that and you said you had tried it!

--

HTH

Bob

"Helmut" <Helmut(a)discussions.microsoft.com> wrote in message
news:C21C1B54-5E12-4E46-B157-5915E156997A(a)microsoft.com...
> Bob,
> The following did finally work:
>
> ' Save File as "xlsm" in new location
>
> Do
> fName = Application.GetSaveAsFilename(InitialFileName:=Myvalue,
> filefilter:= _
> " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,")
> Loop Until fName <> False
>
> ActiveWorkbook.SaveAs Filename:=fName,
> FileFormat:=xlOpenXMLWorkbookMacroEnabled
>
> Thanks for your help anyhow.
>
> "Bob Phillips" wrote:
>
>> This is odd Helmut. I have just tried your code and it works fine for me,
>> I
>> didn't even need the FileFormat property, so there must be something else
>> in
>> your code.
>>
>> HTH
>>
>> Bob
>>
>> "Helmut" <Helmut(a)discussions.microsoft.com> wrote in message
>> news:43C89CC1-746F-42BB-B0A3-FD18B58DA53F(a)microsoft.com...
>> > Bob,
>> > I get "Run-time error '1004' - Method 'SaveAs' of 'object '_Workbook'
>> > failed."
>> > Helmut
>> >
>> > "Bob Phillips" wrote:
>> >
>> >> Did you try adding FileFormat:= xlOpenXMLWorkbookMacroEnabled to the
>> >> save
>> >> statement?
>> >>
>> >> HTH
>> >>
>> >> Bob
>> >>
>> >> "Helmut" <Helmut(a)discussions.microsoft.com> wrote in message
>> >> news:A7800D7D-0321-4535-A708-A2519A13753B(a)microsoft.com...
>> >> >I have the following code within an "xltm" file which I want to then
>> >> >save
>> >> >as
>> >> > "xlsm":
>> >> >
>> >> > Do
>> >> > fName =
>> >> > Application.GetSaveAsFilename(InitialFileName:="kupa",
>> >> > filefilter:= _
>> >> > " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,")
>> >> > Loop Until fName <> False
>> >> > ActiveWorkbook.SaveAs Filename:=fName
>> >> >
>> >> > I get ERROR on last statement. How can I add "FileFormatValue = 52"
>> >> > to
>> >> > save
>> >> > the file as a "MacroEnabled"
>> >> > thanks
>> >>
>> >>
>> >> .
>> >>
>>
>>
>> .
>>


First  |  Prev  | 
Pages: 1 2
Prev: xlookup & paste a picture
Next: Printing App