Macro To Connect To Infomaker And Run Query
Apr 17, 2014
I'm trying to get my macro to connect to Infomaker and run a query. I have successfully done this in the past by using the record macro function. But, when I try to record the macro and paste the query syntax from Infomaker into the commandtext box of the connection, I get the "too many line continuations" error.
I've been looking at ways to write the code rather than record, but the syntax for the Infomaker queries doesn't seem to mesh well.
The syntax of the query in Infomaker is (copy/pasted, all "'s are necessary):
Code:
SELECT "COMPANY"."CO_NAME",
"COMPANY"."FLAG",
"CO_REF"."CO_VALUE",
"ITEM"."ISSUE ",
"REFERENCE"." ID_VALUE",
MIN(CODE.PROD_CODE)
FROM "COMPANY",
[Code] ........
View 2 Replies
ADVERTISEMENT
Feb 28, 2014
I have a userform with a listbox that has 6 columns (D2:I50) which works great. In column J (J2:J50), I have data which needs wrapping so I plan on putting it in its own listbox. Is it possible to have another list box but one that operates as the first one is scrolled?
View 2 Replies
View Related
Jul 1, 2008
I have more than seven if statements but don't know how to connect them.
works
=IF(C2=$A$2,13,IF(C2=$A$3,7,IF(C2=$A$4,5,0)))works
IF(C2=$A$4,,IF(C2=$A$5,3,IF(C2=$A$6,3,IF(C2=$A$7,3,IF(C2=$A$8,3,IF(C2=$A$9,3,IF(C2=$A$10,3,IF(C2=$A$11,3,0))))))))can these be connected? they work for me separately but not all in one.
I've tried Named but that doesn't work because there are way too many things I need to do w/ it.
View 9 Replies
View Related
Feb 28, 2008
Im writing a program in VBA excel that displays two circles in excel spreadsheet, these two circles have been set X and Y Co - ordinates. Using the X and Y Co - ordinates i want to connect a line from shape 1 to shape 2
ActiveSheet.Shapes.AddLine(495.75, 234#, 682.5, 234#).Select
View 3 Replies
View Related
Nov 6, 2007
I was trying to move data from excel to access database in VBA. not sure if this has been done before.
What i have got at the moment is that there are some data in excel spreadsheet that i can dump into the table in the access database. My problem here is i need to be able to open the database first, set up connection, and then perform SQL insert query command.
So in the worksheet, i have a button with the following codes in it
so far i could just manage to open the database as follows
View 13 Replies
View Related
Nov 25, 2005
Is there a way to connect direct to the newsgroup below via OE6:
microsoft.public.excel.worksheetfunctions
It doesn't appear in the newsgroups' list ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
View 13 Replies
View Related
Apr 17, 2009
how to do this with Java but not VBA, I have the capability of understanding it I just need to know where to look because I can't seem to find any solid information on the net from my searches. Does anyone have any websites, other threads or anything they could direct me to for this kind of thing.
I was contemplating putting this in the Access thread but I want to connect to Access through Excel so I think it fits both.
My plan is to use a macro to send specific cells to five seperate tables in an Access database using VBA and SQL.
View 9 Replies
View Related
Apr 4, 2007
I've created a button on a sheet that triggers the creation of a checkbox on the ActiveCell. I also want the checkbox to link to the activecell in order to use the TRUE or FALSE values in an AutoFilter. I used the following code, but the checkbox doesn't link to the ActiveCell. I thought it might be because the LinkedCell = "TEXT" whereas a Range isn't text?
Sub AddHoekCheckBox()
Dim MyRange As Range
Dim CBLeft As String, CBTop As String, ctlName As String
Dim cbObj As OLEObject
Dim MyDoc As Worksheet
Set MyRange = ActiveCell
CBLeft = CallByName(MyRange, "left", VbGet) + 0.25 * CallByName(MyRange, "Width", VbGet)
CBTop = CallByName(MyRange, "Top", VbGet)...........................
View 3 Replies
View Related
May 28, 2012
I am trying to get some data on a excel. This data is available on a unix OS solaris server.
The data is available in tabular format on the txt file in the server and i need to populate this data on my excel sheet.
How to connect to unix from excel and how to get the data.
View 1 Replies
View Related
Feb 26, 2007
Some time ago, a friend of mine told me he didn't use any Pivot Tables at all, due to the imense space they require.
Instead, he made connections between Forms in Excel and the Databases using SQL.
Do you know of any Internet site where I can start to learn something about this?
View 9 Replies
View Related
Dec 30, 2009
How To Connect Live Data in an Excel Sheet?
I want to track changes in some Stocks, I have made a sample file in Excel and would like to make it Live by Connecting it to a website..
However, I do not know how to go about the same?Can some please provide some examples as well as a File if possible explaining how it was done..
View 9 Replies
View Related
May 9, 2013
I have a requirement to pull report from BMC remedy using VBA. I am sure that many people would have achieved this. .
View 1 Replies
View Related
Feb 12, 2013
I have 2010 Excel and MS SQL 2008R2.
I'd like to import data from my stored procedure from MS SQL into a cell in Excel....
No pivot.
I looked for a standard coding all over the place - no success.
View 1 Replies
View Related
Jan 28, 2014
I have 6 Slicers in called "Quantrix" The slicers are called REG, DIRECTOR, AREA MANAGER, AOI, DMA, AG and CLOCK. I have 15 pivots (6 in Quantrix tab and 9 in a tab called "Pivots").
I have vba code to update all pivot cache (showing 1 pivot update below) ...
PHP Code:Â
    Max = Sheets("eLink_Raw").Cells(Rows.Count, "A").End(xlUp).Row
    Sheets("Quantrix").PivotTables("Quantrix 1").ChangePivotCache ActiveWorkbook. _
      PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
      Sheets("eLink_Raw").Range("A1:AW" & Max).CurrentRegion _
      , Version:=xlPivotTableVersion14)Â
Here is the code to disconnect SLICER, update source data for ALL pivots then reconnects slicer... This works great but its ONLY 1 SLICER
PHP Code:Â
 Dim vPivots As Variant
    Dim i As Long
    Max = Sheets("eLink_Raw").Cells(Rows.Count, "A").End(xlUp).Row
    With ActiveWorkbook.SlicerCaches("Slicer_REG").PivotTables
[Code] .....
How can i disconnects ALL Slicers, change source data for ALL Pivots then reconnect ALL slicers?
View 14 Replies
View Related
Oct 18, 2012
i found this code...
Code:
Sub Button1_Click()
Dim cnt As ADODB.Connection
Dim rst As ADODB.Recordset
Dim stSQL As String
Dim SNfound As String
'Your sqlserver 2008 connection string
Const stADO As String = "Provider=SQLOLEDB.1;" & _
"" & _
[code].....
but i dont see where to put in the Database object...
The Database it needs to connect to in SQl is called
The Server name is SQLSRV when you expand databases the database is called SWHSystem the Table is called dbo.Credential and from that i need to get SELECT All from the Name and CardNumber from dbo.Credential and put that in a New Sheet titled Personal
using Excel 2010 connecting to SQL 2008
View 4 Replies
View Related
Mar 6, 2007
I'm using this macro in order to bring some data to two cells.. it's currently working great...
Sheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://magpie.boise.itc.hp.com:8080/gip/fileStatus.jsp?transKey=GUS8301D&fileName=GUS8301DBN2AFH3M" _
, Destination:=Range("A1"))
.Name = "fileStatus.jsp?transKey=GUS8301D&fileName=GUS8301DBN2AFH3M"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
However, as you can see from the text in bold i'm currently telling the url instead of bringing it from a cell with an url. I want the macro to be able to select the url from a cell.
I'm trying to use this solution, but i keep getting a Run-time erro ´5´:
Invalid procedure call or argument.
connstring = Range("GUS8301!B3").Value
With ActiveSheet.QueryTables.Add(Connection:=connstring, _
Destination:=Range("A1"))
View 9 Replies
View Related
Jul 4, 2008
i have recorded a macro wherein i need to copy paste some data in my database everyday.
now the problem is tht the macro doesnot catch the last row.
for instance if i paste data today in A2:A10
tomorrow it should automatically paste data starting from A11.
the range of data tht i copy is not fixed.
This is a part of macro...
Range("A1").Select
Selection.End(xlDown).Select (This takes me to the last record on that row)
is there anyway i can copy the data in next column?
'Range("A11").Select (This will work only for the first time when i run the macro)
but if i use the same one tomorrow
Range("A1").Select
Selection.End(xlDown).Select This will take me to the last record but..
it will again go to
'Range("A11").Select
and then paste records there
View 9 Replies
View Related
Oct 22, 2007
I worked on this macro for about 2 hours, with only partial success.
I have credit card data (will attached next post) sorted by tender type. I recorded teh subtotal feature, after selecting the data. I used teh go to, special, last cell, feature to get the end cell for selection, and also set the print area to this range. I did it in relative mode.
the macro worked, but when I also tried to insert three rows above the "grand total" cell, then insert a sub total of just master card adn visa, it in one of these added rows didn't work upon playback.
also - Can I lock the position of my macro buttons? IN properties it's set to locked but they still move when teh data changes. Can i put them on teh tool bars?
View 12 Replies
View Related
Dec 15, 2006
So I have some data that I'd like to extract from some financial sites that I'm a member of (one in particular is investors.com). I try and pull stock info from the site, but I have to manually initiate a new web query, go to the website, login, then cancel the web query for the macro on my spreadsheet to start pulling information. What I'd like to do is have two cells referencing my user id and password, and then click a button that will goto the website from excel, login, and allow the extraction of financial info to occur.
View 6 Replies
View Related
Mar 12, 2007
I have a Excel database query which of which i import into Sheet 1. On a daily basis I need to edit this query and change a critea field to yersterdays date. Is there a way in which I could run a macro to change this query for yesterdays date without having to manually go into the query?
I have tried to run the macro, however I can only run this if I have a specific date in my code e.g. 11/03/2007 and not a formula to show yesterdays date.
View 9 Replies
View Related
Apr 2, 2007
I want to write some VBA that retrieves data from a lotus notes database into excel. I will then have some other code that manipulates the data for the user. I have managed to do this with MS Query manually. However when I start to put into VBA my problems start. As I do not know Sql I use the macro record function. This worksso far so good. The problems seem to start when I re-run the macro and try to save the workbook. Excel just sits there with the CPU running at 99%. I left the pc for an hour and it was still in the same condition with the status bar showing save.
Sub Macro4()
With ActiveSheet.QueryTables.Add(Connection:= Array(Array( _
"ODBC;DSN=premax;Database=Premaxse000273.nsf;Server=local;UserName=John Cross/bsp;EncryptMaxSubquery=20;MaxStmtLen=4096;MaxRels=20;M" _
), Array( _
"axVarcharLen=1024;KeepTempIdx=1;MaxLongVarcharLen=1024;ShowImplicitFlds=0;MapSpecialChars=1;ThreadTimeout=60;" _ .............................
View 4 Replies
View Related
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
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
Jan 29, 2008
I have an access database that has many queries and in order to speed it up I have a Macro in access that runs it in no time, but I need to be able to run the query in access via a trigger in Excel and have come up with the below, but it's not working.
View 9 Replies
View Related
Jun 16, 2008
I am trying to write a creative procedure that on workbook open will check the name of the worksheet if it includes the day's date in sheetname & if it doesn't rename the sheet & delete current region from A1, else exit the sub.
Then runs a query on an Access DB to place in the above worksheet.
I need this due to novice XL & DB (8)users.
This is what I have at the moment on a test DB courtesy of J Walkenbach's sample files .....
View 9 Replies
View Related
Nov 21, 2006
I am running a Showcase query from inside excel. I want the query to update, drop the data in excel save it and then close. The problem is that the save command is executing before the data is dropped. The Wait command pauses all processes so it won't work. Is there a way to have a minute of filler until the data is dropped so it will save?
View 5 Replies
View Related
Dec 19, 2006
The actual link from a list on the left side of that web page is "Printable List".
I can't work out why all other web pages work fine with;
Get External Data/Web Query, but this particular web page won't work.
Sub Test_A()
Sheets("test1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://acttab.com.au/interbet/racing?type=venues", Destination:= _
Range("A3"))
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
End Sub
View 3 Replies
View Related
Feb 26, 2009
I have created an Excel sheet that retrieves data from a ODBC source. I have created a macro using macro recorder to refresh the data by re-connecting to the database. However, the connection requires a password prompt and when the macro is run, you are still required to enter the password.
Is there anyway to make the macro so that the password is automatically entered and the user will just have to press a button to fully run the query update?
View 2 Replies
View Related
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
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