Query Tables And Screen Flickers

May 9, 2012

No, this is not about ScreenUpdating = True/False

Neither is it because you've turned SU off, and then used 'Select' or 'DoEvents' etc in your code.

When running an update for a QueryTable (once a second), 3 'buttons' (activeX image controls with code behind them) flicker - though I see no reference to selecting and/or screenupdating in my code

Is this purely something about refreshing a querytable that I can't fix?

Is there a subclass or API call I can intercept to stop drawing the images alone?

Code:

Public Sub ActivateConn()

Dim strFilespec As String
Dim strConn As String
Dim sqlStr As String

Set RecSet = New ADODB.Recordset

[Code] .....

In short, there's no REASON why I couldn't just use the selection_change event to fire the same macros as the buttons but... well... it doesn't look anywhere near as good (I have a thing about making VB apps look as good as the code behind them is smart)

View 9 Replies


ADVERTISEMENT

An Object Code= Flickers The Screen

Nov 27, 2009

way i could stop my sheet from flickering everytime i change my cell selection via keyboard/mouse. i checked and this problem is only with code below that i run in view code of my sheet...

PHP
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim str As String
Dim cboTemp As OLEObject
Dim ws As Worksheet
Set ws = ActiveSheet
On Error GoTo errHandler

If Target.Count > 1 Then GoTo exitHandler
If Target.Address(False, False) = "Z3" Then
    Call GoToMatch
    Exit Sub
End If

View 9 Replies View Related

Screen Flickers On Selection Change Event?

Mar 9, 2012

My screen flickers when I use the following code.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim WTH As Long
If Target.Row = 19 Then
WTH = 1
End If
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
If I comment out the code, my screen doesn't flicker.

In the "Tmp = 1" line I was using the special cells method to color constants red (without selecting anything). When I use that code instead of the "Tmp=1" line, it takes about a second to change cells, and I see the "4 Processors Calculating Message" in Excel when the code fires--even if it's not in row 19.

View 6 Replies View Related

Update Screen After Data Query Refresh

Dec 18, 2006

I am bringing data in from an ODBC database, I am using ActiveSheet.QueryTables(1) and then .refresh.

I want to run a sub after the data has been brought in which finds the last row and adds a formula.

The problem I have is that the data brought in is not show on the screen until all of the macros are finished.

Is there a way of forcing the screen to update?, I have tried the recalculate and refreshall commands or is there another method I should be using?

Sub autofill()

Dim myobj As Object

If ActiveSheet.QueryTables.Count > 0 Then
Call clearscreen
Application.DisplayAlerts = False

Set myobj = ActiveSheet.QueryTables(1)

I require the data to be on the screen before I can find the last row used which is done in "addmaths"?

View 5 Replies View Related

Inserting Query Tables In Active Sheet

Feb 26, 2013

When using

VB :ActiveSheet.QueryTables.Add

How would you get the code to overwrite whatever is in the worksheet as opposed to adding new columns?

View 1 Replies View Related

Web Query - Import Just Specific Tables On Site?

Aug 17, 2013

I have a website (National Lacrosse League - 2013 Regular Season - Standings), that I want to pull information off and automatically into Excel.

I have been using web queries on other websites, and they have worked beautifully, however the tables that I want aren't recognised by the web query wizard (no yellow/black arrows). I can import the whole page through a query, however that's not really practical.

Is there a way I can import just specific tables on this site?? I'd like both the 'east' and 'west' tables.

View 8 Replies View Related

Delete Query Tables Macro Code

Aug 14, 2008

I am currently working on a project that uses Excel to parse a .txt document. Its working quite well for me. It functions by having two worksheets. In the first worksheet I use the " import external data" menu to import my .txt file. In another worksheet I have set up fields that show only the important information from the .txt file and leave the junk behind.

I’m looking to improve the functionality of this by adding a button to automatically clear the data in the first worksheet so that new data can be added quickly.

I have searched the forum and found a couple of threads on "QueryTables". After reading up on those, I have made a simple button with the following code.

Sheets("Sheet1"). Cells.Clear
Sheets("Sheet1").QueryTables.Item(1).Delete

After I load a .txt file and parse it using the formulas set up, I copy my needed information and then press this button. The cells clear, and the QueryTables are "reset" (maybe not the right word). Now a different .txt file can be imported and the process starts again.

The problem I am having is that. If there is no "QueryTables.Item(1)" to delete, I get a run time error. (Run-time error '9': Subscript out of range).

Would anyone know how to make my button conditional to having a "QueryTable" active? I.E. If I press it when there is no data loaded it doesn't do anything or give me that error.

View 4 Replies View Related

Query Tables DataTypes And ColumnWidths Arrays As Variables

Jul 12, 2011

How do I set the datatypes and columnwidths as variables? I get invalid procedure call or argument. Will import different text files and set dt and cw based on names.

Dim dt As Variant
Dim cw As Variant
dt = "2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2"
cw = "7, 7, 5, 2, 7, 16, 3, 15, 11, 9, 9, 9, 7, 3, 3"
With ActiveSheet.QueryTables.Add(Connection:="TEXT;B:BOMOEBTRfro1.txt", Destination:=Range("A1"))

[Code] ........

View 8 Replies View Related

Excel 2007 :: How To Use Query Tables With Multiple Web Pages

Apr 22, 2014

I'm trying to query a web site and export the data to a single sheet in Excel. I've used the record macro function in Excel (2007) and come up with the following but I want to query over 20 pages from this site and wondered if there was any way in looping this macro to do the hard work for me;

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.futwiz.com/en/players", Destination:=Range("$A$1"))
.Name = "players_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False

[Code] ........

On the second page the URL changes to;

URL;FIFA 14 Ultimate Team Players - FUTWIZ

and the .Name field changes to;

.Name = "players?page=1_1"

and on the 3rd page I get;

URL;FIFA 14 Ultimate Team Players - FUTWIZ

and..

.Name = "players?page=2"

View 3 Replies View Related

Excel 2013 :: Creating Two Tables That Can Reference With Microsoft-query

Jun 28, 2013

I don't have Excel 2013 so unfortunately I can't easily create relational data in Excel 2010. I'm looking for a solution to a design problem. I'd like to have 2 tables which I can join with Microsoft Query and run pivot table reports.

My department processes payments, both for internal clients and external clients. My Payments table looks like:

Date | Type (internal/external) | Operation (what type of payment) | Method (internet, mail, etc) | Quantity

Additionally, I have a table for Mail Opening, which looks like:

Date | Employee | Operation | Quantity

My overlapping fields are Date and Operation. Using each table individually, I can get nice pivot table reports. What I'd like to do though is be able to not just see what operations and methods were run each day with what quantities, but also to compare that to how much mail was opened. Employee and Operation is a multi-multi relationship, so when I join by date, I end up getting incorrect numbers because of problems with the data layout. I'm open to changing my data structure, as I know the way it's set up right now isn't great, but I'm having a mental block on how to redesign it. I attached a sample workbook.

View 3 Replies View Related

Removing Data Connections And / Or Query Tables Before Saving File?

Oct 10, 2013

I've tried to remove connections after saves and have been unsuccessful.

HTML Code:
' Delete Additional Connections
' If ActiveWorkbook.Connections.Count > 0 Then
' For i = 1 To ActiveWorkbook.Connections.Count
' ActiveWorkbook.Connections.Item(1).Delete
' Next i
' Else
' MsgBox ActiveWorkbook.Connections.Count
'
' End If

HTML Code:
' Remove named ranges
For Each nm In ActiveWorkbook.Names
nm.Delete
Next nm

I've tried both of these and the Excel file is still attached with XML to the query table. I get an error message saying the format is different then if you click okay it shows its connected to the database still. Is there an aggressive command that will severe all connections before saving? What commands to run to stop this connection after save to another workbook?

View 2 Replies View Related

Application Onkey: Prevent Users From Using The Print Screen Or The Alt Print Screen Buttons On The Keyboard

Dec 29, 2009

I'm just looking to prevent users from using the print screen or the alt print screen buttons on the keyboard. I have this script that works if I use "39" (Right Arrow)but wont work if I use "42" (Print Screen Button).

View 5 Replies View Related

Excel 2010 :: Creating Multiple Tables In VBA And Referring To Newly Created Tables?

Jul 1, 2013

Using Excel 2010. I'm writing a macro that sets up a workbook to be used for estimating at the beginning of a project. In the code I need to create multiple tables (formerly known as "lists") in the workbook. Then later in the code I need to refer back to those newly created tables. Currently, the code that creates the table is part of a loop that creates the table on many different worksheets. The problem of course, is that I have to name the Table, and then it won't create a table of the same name on the next sheet. Then, later in the code, I need to make adjustments to the table that was just created before looping to the next sheet.

Is there a way to create a table without giving it a constant name? Or by giving it a name that builds off of other info in the sheet? For example, I would be good with the naming the table after the sheet name: "Sheet1_Table" or such.

Code:
Sub Auto_Open()
'
Dim sht As Worksheet
If Range("A1") = 1 Then

[Code].....

View 2 Replies View Related

Pass Parameter From Excel Through MS Query To MS Access Query

Nov 26, 2012

I have an MS Access query that contains a parameter. The parameter is a date field, and I have configured that in the Access query. If I run the query within the MS Access user interface, it prompts me for the paramater value as expected, and runs just fine. However, I want to connect to this query from within Excel as a data source.

I have created a connection to the Access file using ODBC from within Excel. In the MS Query window, I am merely selecting all of the fields resident in the MS Access query, and returning all values. In other words, there is no selection criteria in the MS Query. I have done this many times with Access queries that DO NOT contain a parameter, and everything works fine. However, in this instance, I need to pass a parameter through to MS Access in order for the query to run. At the moment, I get the "Too Few Paramaters...1 expected" error message. This makes sense, because I haven't figured out how to pass the paramater to MS Access.

Is there a way to structure this that does not involve VB code? If so, I'd love to know how. I have tried creating parameters in MS-Query with the same name, but although I get the prompt it doesn't connect with the Access query as the source for the parameter value.

If the solution requires using code, I'm good with VB Code in Excel...is there VB for Excel code that could make this happen?

Failing that, I guess there must be (I've seen a few in my search thus far) Access VB Code that can make this work. I'm very rusty using VB with Access, so this is my least favored solution. However, if this is the only option, keep in mind that I need to pass the paramater ultimately from a user who will initiate the process using Excel.

View 3 Replies View Related

Query Parameters Which Takes The Date From The Cell Into The Query

Mar 29, 2007

Need the query parameters which takes the date from the cell into the query. How should I modify my query if it needs to take the date from a cell?? The bold one date should be picked from one of the cell in sheet 2.

My query is this
WEB
1
http://fc-web-phl1-101.phl1:8090/gp/...runReport.y=12

Selection=15
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False

View 2 Replies View Related

Create An Conection With MS QUERY To A Csv And Query Data

Sep 6, 2008

I have a csv file on another drive on the network that i need to query. I believe that ms query would be the best way. I know that a DSN needs to be setup but this macro will be used by various users who wont know how to do that. thus I would like to create one via VBA every time the task needs to be run.
I haven't a clue how to do this and i need it to be explained to me in general terms with words of one syllable!

View 9 Replies View Related

Query An Access Query With VBA Function

Jul 8, 2008

I'm trying to query a query in Access 2003, from Excel 2003.

The query in Access looks like:
AccessQuery: [SELECT VBAFunction(field1) FROM Table]

The query in Excel looks like:
ExcelQuery: [SELECT * FROM AccessQuery]

I use the following VBA code in Excel to excecute the query:

With ThisWorkbook.Worksheets(cDataSheetName).QueryTables.Add(Connection:=strConnection, _
Destination:=ThisWorkbook.Worksheets(cDataSheetName).Range("A1"), Sql:=strQuery)
.RowNumbers = True
.Refresh BackgroundQuery:=False
iResultRowCount = .ResultRange.Rows.Count
End With
When I execute this code I get the error message 'SQL Syntax Error' (Error 1004). When I remove the VBA function from the query in Access, it all works fine.

View 9 Replies View Related

Edit Query Using Query Wizard

Apr 25, 2006

I created an Ms Excel Database Query to bring in data from MS Access. (versions 2002 of MS Excel and Ms Access). The query works fine initially. I can right click, choose Edit Query and change my criteria. Results are returned almost instantly.

My problem is that, once I save the workbook, or autosave happens, I get an error when I right-click to Edit Query: This query cannot be edited by the Query Wizard..

View 2 Replies View Related

MS Query - Parameters (parameters On A Query But Use A Wildcard To Return All Instances)

Nov 17, 2009

Is it possible to set parameters on a query but use a wildcard to return all instances? I have a query that I want to be able to set multiple parameters on but give the user the ability to select as many or as few parameters as they want to see. 2 of the parameters are number fields and 2 are text fields with no spaces.

View 4 Replies View Related

2003 Is Too Far Up On The Screen

Sep 27, 2009

I did the restart our company required and when Excel reopened it was on my laptop rather than the big screen. I run 2 screens. Excel 2003 is now so far up on the laptop screen, I cannot move it. I can barely see File, Edit, View, etc. How can I drag Excel down so I can resize it?

View 4 Replies View Related

Screen Size

Dec 7, 2009

what size monitor do you use?

I'm thinking about upgrading my 17" to a 23" monitor so I can see more cells without zooming

Anyone currently use a 23" for Excel?

View 14 Replies View Related

Screen Position

Aug 18, 2009

I would like to end a macro with a specific cell (e.g. E50) in the first cell in the upper left hand corner of the screen. How might I accomplish this?

View 3 Replies View Related

Can't Get Screen To Go All Way To Top Of Page

Nov 21, 2011

I cant get my screen to go all the way to the top of the page! & there is a 2 inch or so area at the bottom of the worksheet as well. I need to get my display back to normal!

View 4 Replies View Related

Print Screen

Jul 6, 2007

macro minimizes excel takes a print screen of the application behind excel then pastes it in a word document then maximizes excel screen again

View 9 Replies View Related

Splash Screen

Nov 22, 2008

I have never created a splash screen and would like to do so now, I am in the VB editor, i have inserted a userform, i would like to insert my company logo on to the userform, how do i do this?

View 9 Replies View Related

Screen Updating

Feb 13, 2009

Is there a way to disable updating to the screen but have a message displayed to the user while a macro is running? Something like a userform displayed on the screen or a message in the status bar. I vaguley remember you could "print" message to the status bar in LotusScript, wondering if there is something similar in Excel.

Application.ScreenUpdating = False
"the macro is running, hang tight"
...macro code in here...
Application.ScreenUpdating = True

View 9 Replies View Related

Screen Refresh

Nov 18, 2009

I have a large workbook with about 20 worksheets that I have used for several years without problems. Recently, I have been getting strange behavior when the screen refreshes. The biggest problem is that I get images of other worksheets covering my current worksheet when I change a cell. I can make them go away by scrolling or flipping between another worksheet and back. I have tried using manual recalc and this has helped somewhat but I can still get the images sometimes. The workbook contains VBA that performs various tasks on every worksheet (unlock, update pivots...) but these have been in there forever. There is also one piece of code that performs advanced filtering. I can only think there was something changed with a security patch, but I wanted to know if anyone else has had this issue and might be able to provide some advice on how to prevent it.

View 9 Replies View Related

Resize Userform To Fit Screen?

Jul 20, 2013

stretch" the userform to fit the height and width fo the screen. I dont want to simply change the height and width of the userform, i want the controls within the userform to stretch with the userform so that it looks the same, just fullscreen. this is what ive found by googling:

VB:
With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Width = .Width
Height = .Height
End With

however, this just stretches it to match the width of my screen, but doestn consider the height, so that if i have a widescreen vs a square screen it will cut off the bottom of my userform. It would be great if there was a zoom type featur that zooms the vertical and horizontal dimensions seperately... more like a stretch than a zoom.

View 2 Replies View Related

Saving An Image Of My Screen

Mar 12, 2009

I want to save an image of my worksheet, after I have right clicked, to be used in a power point presentation. How do I do that?

View 2 Replies View Related

Keep Subheaders Visible At Top Of Screen?

Apr 30, 2013

Been trying to figure out if there's a way to keep sub-headers visible at the top of the screen.

Basically I want the main headers locked at the top (via freeze panes), but then I also want certain rows, which would be sub-headings, to stick to the top of the screen until the next sub-header row gets to the top of the screen, at which point that row would replace the other one at the top.

The best example I can provide of the behavior I'm looking for is on the iPhone Contacts list. When you scroll through the contacts you see the listings, but as you scroll into each new letter that particular letter's sub-heading stays stuck at the top of the screen until you scroll down to the next letter.

So example would be:
Quantity Item Price (this would be the header row locked to the top via freeze panes)
PRODUCE
1 Apple $1
6 Orange $1
8 Pear $2
DAIRY
1 Cheese $5
7 Milk $2

So if you scrolled the above list down PRODUCE would stay at the top even while the Apple, Orange, and Pear lines scrolled off the screen, then it would get replaced with DAIRY when DAIRY reached the top of the screen.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved