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: 570
Default Excel file format.

i am using the code below, i am coming in after this was already built. it
appears that fileformat 16 will not let me password protect the sheet. is
there a way around this? what is file format 16?
i tried oBackLog.SaveAs(cblfile,16,12345) but the sheet was not protected.
so im lost.

osheet.protect("12345")
if File(Cblfile)
Erase(Cblfile)
endif

if nform = 2
oBackLog.SaveAs(cblfile,16)
endif
if nform = 5
oBackLog.SaveAs(cblfile,43,)
endif
if nform = 0
oBackLog.SaveAs(cblfile,-4143)
endif
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Excel file format.

Go into the VBE.
Hit F2 (to see the object browser)
search for xlfileformat

You'll be able to click on each of the member names and see what numeric
constant they represent.

I saw:
xlExcel2 = 16 (&H10)

That sure looks like it is one early format of excel (version 2). I use xl2003
and it's up to version 11.

Maybe that early version of excel doesn't allow sheet protection?

When I ran this:

Option Explicit
Sub testme()
ActiveSheet.Protect Password:="hi"
ActiveWorkbook.SaveAs Filename:="aaa.xls", FileFormat:=16
End Sub

I got a message back:
Run-time error '1004':
Sheet is protected with password. File format cannot be used.

So that looks like a problem.

But why, oh, why would anyone need to save to that version of excel?

Tom wrote:

i am using the code below, i am coming in after this was already built. it
appears that fileformat 16 will not let me password protect the sheet. is
there a way around this? what is file format 16?
i tried oBackLog.SaveAs(cblfile,16,12345) but the sheet was not protected.
so im lost.

osheet.protect("12345")
if File(Cblfile)
Erase(Cblfile)
endif

if nform = 2
oBackLog.SaveAs(cblfile,16)
endif
if nform = 5
oBackLog.SaveAs(cblfile,43,)
endif
if nform = 0
oBackLog.SaveAs(cblfile,-4143)
endif


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default Excel file format.

Dave, im trying to figure out why we need to save in that version also. this
program creates 2000 .xls sheets and emails them. i think the problem is that
some of the folks that are reveiving them dont have the Lastest?

thats the best answer i can give. i got the same error you did.

whats interesting you can protect the sheet without a password,

i fixed it and got it to work.

thanks.

"Dave Peterson" wrote:

Go into the VBE.
Hit F2 (to see the object browser)
search for xlfileformat

You'll be able to click on each of the member names and see what numeric
constant they represent.

I saw:
xlExcel2 = 16 (&H10)

That sure looks like it is one early format of excel (version 2). I use xl2003
and it's up to version 11.

Maybe that early version of excel doesn't allow sheet protection?

When I ran this:

Option Explicit
Sub testme()
ActiveSheet.Protect Password:="hi"
ActiveWorkbook.SaveAs Filename:="aaa.xls", FileFormat:=16
End Sub

I got a message back:
Run-time error '1004':
Sheet is protected with password. File format cannot be used.

So that looks like a problem.

But why, oh, why would anyone need to save to that version of excel?

Tom wrote:

i am using the code below, i am coming in after this was already built. it
appears that fileformat 16 will not let me password protect the sheet. is
there a way around this? what is file format 16?
i tried oBackLog.SaveAs(cblfile,16,12345) but the sheet was not protected.
so im lost.

osheet.protect("12345")
if File(Cblfile)
Erase(Cblfile)
endif

if nform = 2
oBackLog.SaveAs(cblfile,16)
endif
if nform = 5
oBackLog.SaveAs(cblfile,43,)
endif
if nform = 0
oBackLog.SaveAs(cblfile,-4143)
endif


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Excel file format.

I would bet (not a lot, though <vbg) that all your recipients have at least
xl97.

And the xl97 format is the same format used with xl2k, xl2002, xl2003.

I'd send out the 2000 in xl97 format and wait for the stuff to hit that fan.

(Heck, you could even try xl95 format if you have some real stragglers.)

Tom wrote:

Dave, im trying to figure out why we need to save in that version also. this
program creates 2000 .xls sheets and emails them. i think the problem is that
some of the folks that are reveiving them dont have the Lastest?

thats the best answer i can give. i got the same error you did.

whats interesting you can protect the sheet without a password,

i fixed it and got it to work.

thanks.

"Dave Peterson" wrote:

Go into the VBE.
Hit F2 (to see the object browser)
search for xlfileformat

You'll be able to click on each of the member names and see what numeric
constant they represent.

I saw:
xlExcel2 = 16 (&H10)

That sure looks like it is one early format of excel (version 2). I use xl2003
and it's up to version 11.

Maybe that early version of excel doesn't allow sheet protection?

When I ran this:

Option Explicit
Sub testme()
ActiveSheet.Protect Password:="hi"
ActiveWorkbook.SaveAs Filename:="aaa.xls", FileFormat:=16
End Sub

I got a message back:
Run-time error '1004':
Sheet is protected with password. File format cannot be used.

So that looks like a problem.

But why, oh, why would anyone need to save to that version of excel?

Tom wrote:

i am using the code below, i am coming in after this was already built. it
appears that fileformat 16 will not let me password protect the sheet. is
there a way around this? what is file format 16?
i tried oBackLog.SaveAs(cblfile,16,12345) but the sheet was not protected.
so im lost.

osheet.protect("12345")
if File(Cblfile)
Erase(Cblfile)
endif

if nform = 2
oBackLog.SaveAs(cblfile,16)
endif
if nform = 5
oBackLog.SaveAs(cblfile,43,)
endif
if nform = 0
oBackLog.SaveAs(cblfile,-4143)
endif


--

Dave Peterson


--

Dave Peterson
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
Number Format on Excel File saved from .html file joyfulone Excel Discussion (Misc queries) 3 April 15th 09 12:07 AM
Convert Excel XLS file to Quickbooks QIF file format Paul Excel Discussion (Misc queries) 0 October 22nd 07 10:46 PM
cannot open excel file - says invalid file format - what to do? excelless diane Excel Discussion (Misc queries) 2 November 8th 06 03:13 AM
How do I autosave a unique Excel file in the file format 03F67000 flyboy06 Setting up and Configuration of Excel 1 June 14th 06 11:11 PM
Error:Invalid File format,while opening an Excel Template file Saurabh Excel Programming 1 January 17th 05 07:15 AM


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

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"