R
Revolution
Dear All,
I planned to write a code which will automatically set a random password.
For that first I used the macro and I copied the code from VBA to VB but it
won't work properly. I added the following references Microsoft Office
Library and Microsoft Excel Library.
while executing code I faced this error message "Object Variable or With
block variable not set"
Please explain why it is happening I need to follow any other steps to do
before coping the code.
Here is the code from VBA..
-------------------------------
Sub file (pwd As String, filename As String)
' file Macro
' Macro recorded 12/26/2005 by Revolution
ActiveWorkbook.SaveAs FileName:=filename, _
FileFormat:=xlNormal, Password:=pwd, WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
---------------------------------------
In the ActiveWorkbook it gives the Error message
Please let me know u need some other information
Waiting for ur reply
I planned to write a code which will automatically set a random password.
For that first I used the macro and I copied the code from VBA to VB but it
won't work properly. I added the following references Microsoft Office
Library and Microsoft Excel Library.
while executing code I faced this error message "Object Variable or With
block variable not set"
Please explain why it is happening I need to follow any other steps to do
before coping the code.
Here is the code from VBA..
-------------------------------
Sub file (pwd As String, filename As String)
' file Macro
' Macro recorded 12/26/2005 by Revolution
ActiveWorkbook.SaveAs FileName:=filename, _
FileFormat:=xlNormal, Password:=pwd, WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
---------------------------------------
In the ActiveWorkbook it gives the Error message
Please let me know u need some other information
Waiting for ur reply