Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 25th, 2008, 07:11 PM
Registered User
 
Join Date: Dec 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Namespace - how to declare?

Can anyone please advise how I can get the line containing Namespace working in the code below? Does it need a Declaration or Reference file, whatever?

I always get r-time error 91: "Object variable not set or With block not set"

any suggestions, ideas or advice gratefully received.

Code:
Public Function Unzip(DefPath, Fname)
'Unzips A File
'Fname must be FULL Path\Filename.zip
'DefPath must be valid Path you want to Unzip file TO
Dim FSO As Object
Dim oApp As Object
On Error GoTo UnZip_Err:
 
Set oApp = CreateObject("Shell.Application")

'Copy the files in the newly created folder
oApp.Namespace(DefPath).CopyHere oApp.Namespace(Fname).items  '<<<

On Error Resume Next
Set FSO = CreateObject("scripting.filesystemobject")
FSO.deletefolder Environ("Temp") & "\Temporary Directory*", True
Set oApp = Nothing
Set FSO = Nothing
Exit Function


many thanks,

Jil





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to declare variables rehana Beginning PHP 11 April 30th, 2013 04:59 AM
declare My ajkumar Visual Basic 2005 Basics 0 April 18th, 2007 05:24 AM
declare a variable without setting a value to it crmpicco Javascript How-To 1 July 18th, 2005 07:25 PM
declare empty variable jtyson General .NET 2 April 8th, 2004 11:02 AM
how to declare date variables rehana Beginning PHP 1 December 15th, 2003 05:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.