HELP with Automating Excel with VBScript 
Author Message
 HELP with Automating Excel with VBScript

Does anyone know how to automate the procedure of setting a password in
the
save options, before saving an Excel worksheet, using VBScript or
Javascript.

Colin.



Sun, 14 Jul 2002 03:00:00 GMT  
 HELP with Automating Excel with VBScript

Try the SaveAs method...  

All of the arguments are optional, so try it first with just the Password argument.

Sub SaveAs([Filename], [FileFormat], [Password], [WriteResPassword], [ReadOnlyRecommended], [CreateBackup], [AccessMode As XlSaveAsAccessMode = xlNoChange], [ConflictResolution], [AddToMru], [TextCodepage], [TextVisualLayout])

--
Michael Harris

  Does anyone know how to automate the procedure of setting a password in
  the
  save options, before saving an Excel worksheet, using VBScript or
  Javascript.

  Colin.



Mon, 15 Jul 2002 03:00:00 GMT  
 HELP with Automating Excel with VBScript

Michael,
I have tried using the SaveAs method in VBScript to declare a password
but I can only seem to get it to recognise the filename.
I have tried using the following pieces of code:

Sub closesheet()
oWB.SaveAs filename=fn, password=pw
End Sub

where fn and pw are variables declared outside of VBScript in
Javascript.

Sub closesheet()
oWB.SaveAs(filename,'pass')
End Sub

Do you know the correct syntax code for using SaveAs?

Thanks again in advance for any help you can offer me.
Colin.

Quote:

> Try the SaveAs method... All of the arguments are optional, so try it
> first with just the Password argument. Sub SaveAs([Filename],
> [FileFormat], [Password], [WriteResPassword], [ReadOnlyRecommended],
> [CreateBackup], [AccessMode As XlSaveAsAccessMode = xlNoChange],
> [ConflictResolution], [AddToMru], [TextCodepage], [TextVisualLayout])

> --
> Michael Harris



>      automate the procedure of setting a password in
>      the
>      save options, before saving an Excel worksheet, using
>      VBScript or
>      Javascript.

>      Colin.



Tue, 16 Jul 2002 03:00:00 GMT  
 HELP with Automating Excel with VBScript

VBScript doesn't support the VB/VBA named arguments syntax (the syntax of which is actually argName:=argVariableOrLiteralValue)...

Try:

oWB.SaveAs fn, pw

since these are the 1st 2 positional arguments...

--
Michael Harris

  Michael,
  I have tried using the SaveAs method in VBScript to declare a password but I can only seem to get it to recognise the filename.
  I have tried using the following pieces of code:
  Sub closesheet()
  oWB.SaveAs filename=fn, password=pw
  End Sub

  where fn and pw are variables declared outside of VBScript in Javascript.

  Sub closesheet()
  oWB.SaveAs(filename,'pass')
  End Sub

  Do you know the correct syntax code for using SaveAs?

  Thanks again in advance for any help you can offer me.
  Colin.


    Try the SaveAs method... All of the arguments are optional, so try it first with just the Password argument. Sub SaveAs([Filename], [FileFormat], [Password], [WriteResPassword], [ReadOnlyRecommended], [CreateBackup], [AccessMode As XlSaveAsAccessMode = xlNoChange], [ConflictResolution], [AddToMru], [TextCodepage], [TextVisualLayout])  
    --
    Michael Harris

      the
      save options, before saving an Excel worksheet, using VBScript or
      Javascript.
      Colin.



Tue, 16 Jul 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. automate excel in vbscript and saving

2. Help: How do I automate mail merging from within Excel

3. HELP!: Automating Excel on client PV from VB .NET Web Form:

4. automate excel

5. Automate download of excel file

6. Help with importing excel into access using VBscript

7. Still need Help with Excel & VBScript

8. Help on Excel programming with VBScript

9. vbscript for EXCEL...HELP

10. HELP Excel with VBScript

11. calling Excel VBA macro from VBScript in Compiled Help HTML page

12. Help! Excel - VbScript problem

 

 
Powered by phpBB® Forum Software