View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dan R. Dan R. is offline
external usenet poster
 
Posts: 220
Default Create a new Wb on the Desktop

I'm trying to create a new Wb and save it to the desktop... When I run
this, it says the file can't be located... What am I missing?


Sub Test()
Dim csFILENAME As String
Dim wsh As Object
Dim Ws As Worksheet
Dim Wb As Workbook

Set wsh = CreateObject("wscript.shell")
csFILENAME = wsh.SpecialFolders.Item("Desktop")

Set xL = New Excel.Application
Set Wb = xL.Workbooks.Open(csFILENAME & "\" & "Test" & ".xls")

End Sub


Thanks,
-- Dan