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: 23
Default Opening files

Hello,
I have the following sub that works great for regular xls files. Now I
need to use the similar sub but to open excel files that has macros. I am
trying to open xls files without having the macro to proceed. Is there a
way to do this by amending the following code? The purpose is to open files
and then consolidate them into one.

Thank you for your help.

Sub openQuarterlyFiles()
Dim selectedFile As String
Dim wbToOpen As Integer, wsCount As Integer

With objWsQBRfreeB
lastline = Range("A32000").End(xlUp).Row
For wbToOpen = 1 To 10
'display dialog asking user to select a file
selectedFile = Application.GetOpenFilename( _
"Files (*.xls),*.xls", , "Select your Monthly Free Balance
file", , False)
'check if cancel selected then open
If selectedFile = "False" Then
MsgBox "You choose to interrupt loading files."
Call closeQBRFreeBalance
Exit For
Else
Workbooks.OpenText fileName:=selectedFile
Call openDelimitedFile(selectedFile)
End If
wsCount = Workbooks(1).Worksheets.count
Workbooks(2).Activate
Sheets(1).Move After:=Workbooks(1).Sheets(wsCount)
Next
End With
processQfiles
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
Opening files Sandy5590 Excel Discussion (Misc queries) 2 September 8th 09 02:03 PM
show most recent files first when opening excel files Anne` Excel Discussion (Misc queries) 5 January 23rd 08 01:54 AM
Opening Quattro Pro for Windows files (*.WB1 Files) using Excel 20 PoundMutt Excel Discussion (Misc queries) 1 June 20th 07 03:50 AM
How can I view files chronologically when opening multiple files Stevilsize Excel Discussion (Misc queries) 3 July 26th 05 12:49 AM
Opening Files Dave[_32_] Excel Programming 2 October 16th 03 06:25 PM


All times are GMT +1. The time now is 04:06 PM.

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"