I hope some one can help me with a problem I have with sharing files. We are
migrating to Excel 2003 and there is an incompatibility problem with locked
VBA files that are shared. To get round this I thought I could unlock the
file in VBA using send keys , then save and close the file in an early
version of Excel, there by making the file universally acceptable, but
although I can run as two separate macros I can’t combine them into one
operation, Can any one help me? below is the code I have created.
Sub UnlockVBA()
With Application
..SendKeys quot;%{F11}quot;, True
..SendKeys quot;%Tequot;, True
..SendKeys quot;fredquot;, True
..SendKeys quot;~quot;, True
..SendKeys quot;~quot;, True
..SendKeys quot;%{F11}quot;, True
End With
End Sub
Sub SaveOldStyle()
Dim fn As Variant
fn = Application.GetSaveAsFilename(quot;MyFileName.xlsquot;, _
quot;Excel files,*.xlsquot;, 1, quot;Select your folder and filenamequot;)
If TypeName(fn) = quot;Booleanquot; Then Exit Sub
ActiveWorkbook.SaveAs fn, FileFormat:=xlExcel9795
End SubPerhaps...
Sub UnlockVBA()
With Application
.SendKeys quot;%{F11}quot;, True
.SendKeys quot;%Tequot;, True
.SendKeys quot;fredquot;, True
.SendKeys quot;~quot;, True
.SendKeys quot;~quot;, True
.SendKeys quot;%{F11}quot;, True
End With
Application.OnTime DateAdd(quot;squot;, 0, Now), quot;SaveOldStylequot;
End Sub--
Jim
quot;MikeFullamquot; gt; wrote in message
...
|I hope some one can help me with a problem I have with sharing files. We
are
| migrating to Excel 2003 and there is an incompatibility problem with
locked
| VBA files that are shared. To get round this I thought I could unlock the
| file in VBA using send keys , then save and close the file in an early
| version of Excel, there by making the file universally acceptable, but
| although I can run as two separate macros I can't combine them into one
| operation, Can any one help me? below is the code I have created.
|
| Sub UnlockVBA()
| With Application
| .SendKeys quot;%{F11}quot;, True
| .SendKeys quot;%Tequot;, True
| .SendKeys quot;fredquot;, True
| .SendKeys quot;~quot;, True
| .SendKeys quot;~quot;, True
| .SendKeys quot;%{F11}quot;, True
| End With
| End Sub
|
| Sub SaveOldStyle()
| Dim fn As Variant
| fn = Application.GetSaveAsFilename(quot;MyFileName.xlsquot;, _
| quot;Excel files,*.xlsquot;, 1, quot;Select your folder and filenamequot;)
| If TypeName(fn) = quot;Booleanquot; Then Exit Sub
| ActiveWorkbook.SaveAs fn, FileFormat:=xlExcel9795
| End Sub
|
- Mar 13 Thu 2008 20:42
Protected VBA and 2003
close
全站熱搜
留言列表
發表留言