Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Macro freezes after using Filters.

I have a macro that does the following, it deletes all the data within the
spreadsheet, imports 2 files and then saves the spreasheet. This macro works
fine but when filters have been used within the spreadsheet and i come to run
the macro the spreadsheet freezes on me everytime. Even if i clear all the
filters the error still appears. To work around it i have to remove the
filters, exit and save the spreasheet and then re-open it. The Macro then
works ok again.

Thanks
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Macro freezes after using Filters.

The code is below, Thanks

Sub Qualityimport()
'
' Qualityimport Macro
' Macro recorded 24/07/2006 by COATESD
'

'
Application.Goto Reference:="R2C1"
With Selection.QueryTable
.Connection = "TEXT;K:\Mfgpro\datefile.txt"
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1)
.TextFileFixedColumnWidths = Array(8, 10)
.Refresh BackgroundQuery:=False
End With
Application.Goto Reference:="R4C1"
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
Application.Goto Reference:="R4C1"
With Selection.QueryTable
.Connection = "TEXT;K:\Mfgpro\qextract.prn"
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1)
.Refresh BackgroundQuery:=False
End With
Range("A4,C:C").Select
Range("C1").Activate
ActiveWindow.SmallScroll ToRight:=2
Range("A4,C:C,G:G,I:I,J:J").Select
Range("J1").Activate
Columns("G:G").EntireColumn.AutoFit
Columns("I:I").ColumnWidth = 10.57
Columns("J:J").ColumnWidth = 7
Columns("C:C").ColumnWidth = 10.14
Columns("C:C").EntireColumn.AutoFit
Range("H1").Select
ActiveWorkbook.Save
Range("C1").Select
End Sub


"Don Guillett" wrote:

as ALWAYS, post your code for comments

--
Don Guillett
SalesAid Software

"davemel" wrote in message
...
I have a macro that does the following, it deletes all the data within the
spreadsheet, imports 2 files and then saves the spreasheet. This macro
works
fine but when filters have been used within the spreadsheet and i come to
run
the macro the spreadsheet freezes on me everytime. Even if i clear all the
filters the error still appears. To work around it i have to remove the
filters, exit and save the spreasheet and then re-open it. The Macro then
works ok again.

Thanks




Reply
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
link to combobox legepe Excel Discussion (Misc queries) 4 July 26th 06 04:45 PM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Running filters using a macro MarcusA Excel Worksheet Functions 1 August 16th 05 11:09 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


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