LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Trouble opening worksheet

A simple code opening 1st worksheet from user-identified spreadsheet - lines enclosed in < can be retained or omitted

Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
If fd.Show = -1 Then
FAOfficeFile = fd.SelectedItems(1)
<Workbooks.Open Filename:=FAOfficeFile, ReadOnly:=True
Dim FAOfficeSheet As Worksheet
<Debug.Print Workbooks(FAOfficeFile).Worksheets.Count
Set FAOfficeSheet = Workbooks(FAOfficeFile).Worksheets(1)
End If

gets 'Subscript out of range' error message at Set FAOfficeSheet = line <or Debug.Print line. Could someone please suggest me the solution?

Thank you very much.

 
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
trouble opening old 5.0 file Karen Excel Discussion (Misc queries) 0 April 20th 07 02:34 AM
UGH! Trouble downloading, and opening anything cali Excel Discussion (Misc queries) 1 December 15th 05 06:36 AM
Trouble opening second notebook Molly Excel Discussion (Misc queries) 1 December 8th 04 03:48 AM
Trouble Opening Workbook Steve Andrews[_3_] Excel Programming 1 January 31st 04 10:36 AM
Trouble Opening Workbook Steve Andrews[_3_] Excel Programming 0 January 16th 04 08:06 PM


All times are GMT +1. The time now is 10:34 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"