LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default File name extension


Below is a sub routine that worked great on my machine but when I gave it to
a user, I would get a subscript out or range error. This was due to not
having the .xls extension in the wbname variable or in the windows ( )
activate piece of the code. When calling a file does it always need the
..xls extension?

Sub See_Vendor()
x = ActiveWorkbook.Name

wbname = "Current Vendors.xls" <<<<<<<<<<<<=========

Call WorkbookIsOpen(wbname)
If Err < 0 Then
Workbooks.Open Filename:="s:\finance\acct-gl\current vendors.xls"
End If

Windows("current vendors.xls").Activate <<<<<<<<<<<<<============

For Each n In ActiveWorkbook.Names
n.Delete
Next n
Range("a2").Select
Top = ActiveCell.Address
Selection.End(xlDown).Select
ActiveCell.Offset(0, 3).Select
bottom = ActiveCell.Address
Worksheets("Sheet1").Range(Top, bottom).Name = "Vendor"

Load Vendor_Lookup
Windows(x).Activate
Vendor_Lookup.Show

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determine Excel file version with no file extension. tjlumpkin Excel Discussion (Misc queries) 2 July 23rd 09 06:59 AM
Retrieving Excel File extension based on XL File Format Enumeratio Sasikumar Kannappan Excel Programming 2 June 24th 09 03:59 PM
file format or file extension is not valid...error message Ballun Excel Discussion (Misc queries) 0 May 7th 09 09:06 PM
Additional file with no extension created during File Save As proc Peter Rooney Excel Discussion (Misc queries) 2 August 11th 05 02:48 PM
I need to download an exel spreadsheet file. (file extension :xls) buckrogers Excel Discussion (Misc queries) 2 December 8th 04 11:08 PM


All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"