Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Number Format on Excel File saved from .html file | Excel Discussion (Misc queries) | |||
Convert Excel XLS file to Quickbooks QIF file format | Excel Discussion (Misc queries) | |||
cannot open excel file - says invalid file format - what to do? | Excel Discussion (Misc queries) | |||
How do I autosave a unique Excel file in the file format 03F67000 | Setting up and Configuration of Excel | |||
Error:Invalid File format,while opening an Excel Template file | Excel Programming |