Excel Macro File Which Will Fetch Data From SQL Server
Sep 30, 2013
I have created a macro file which will fetch the data from sql server. Here is the code
f Me.Cmbchoose.Value = "" Then
MsgBox "Please Choose From the drop down Menu!!", vbExclamation
Exit Sub
End If
If Me.Cmbchoose.Value = "Merchants Reports" Then
Dim oConn As ADODB.Connection
[Code] .....
The code is working fine. Now my question is that I want to access it from my home. How do I do that without DSN set up?
View 5 Replies
ADVERTISEMENT
Jul 25, 2014
I am looking to automate our daily sales report.
I am aware of the windows task scheduler.
However, I'd like for this report to run and be sent out very early in the morning (5AM) before I'm even at work.
My computer is usually off because it's with me as I'm commuting into the office.
These files are saved out on our network drive.
Is there a way I can "open" the file and run the macro I have that builds my sales reports with my computer being off?
View 2 Replies
View Related
Dec 20, 2012
For some reason the following Macro won't work:
Code:
Sub ExtractDataTest()
Dim FilePath$, Row&, Column&, Address$
'change constants & FilePath below to suit
'***************************************
Const FileName$ = "Dxo.xlsx"
Const SheetName$ = "Open"
[Code] .......
I get a run-time error '52' on line ("Bad file name or number"):
Code:
If Dir(FilePath & FileName) = Empty Then
And when location is 'C:' it works and I don't get an error.
View 2 Replies
View Related
Aug 29, 2006
I am trying to open set of excel files to fetch data starting from a master excel file where the links are given using a loop. Some of files given as links are either absent or the link is wrong.
* What is the syntax to find if the link is correct/present
* What is the syntax to find if the file is present in specified location
* What is the syntax to find if the file is password protected to open
* I use error handler to resume the next statement if OPEN statement fails.It works fine inside the loop only for first two files.
For example if the third link is errorneous the error handler fails and RUN TIME ERROR occurs.
View 5 Replies
View Related
Jun 13, 2007
Is there a way to capture the records(which meets the criteria) from different excel sheets' sheet1 (A.xls,B.xls) located in some path (c: est) and copied them into our own Result.xls spread sheet?
It would be great and very useful, if you could provide the solution for this.
View 9 Replies
View Related
Oct 22, 2013
Attached is my .xls with dummy data Fetch data By Director.xlsx.
My intention is that once the Director and Month in tab 'By Director & Month' is chosen and the Fetch Data commandbutton is clicked, a new workbook should open.
This new work book should have :
all entries in tab 'Monthly Invoice Input' for that Director-Month combination,along with a sum total of column Q(Total invoice amount) in the last row.
View 6 Replies
View Related
Aug 10, 2014
I am trying to create a macro for vlookup. Each time the name of the source file changes. I dont want to update the formula everytime. So Iam trying to do a macro which will fetch the data from the file that the user mentions in the sheet2.
I have attached the source file and the VLookup file. Now when I enter the source file path in sheet 2 of workbook "Vlookup", and then if I run the macro it should open the file and put the dates in Sheet1 (Columns "D" and "E") of workbook "Vlookup". The dates in the source file will be available in sheet 1(column F and H) of that workbook.
View 1 Replies
View Related
Apr 4, 2014
I want some code on how to fetch data from an Excel Database and display it on respective textbox.
Like I have these coloum name in excel sheet; Emp Id
Name
DOB
Dept
Reporting to
Transport req.
I want to have VBA code to fetch it on txtbx1, txybx2 and so on.
View 1 Replies
View Related
Jul 31, 2006
I'm trying to open a file from server.After doing all the changes I have to save the file back to the server in the same name. It is asking for save as option.it shouldn't. I want to save the file in the same path and in same name without asking the option of "Save as". I hv full permission for editing the file
View 4 Replies
View Related
Jun 13, 2008
I try to run a macro on my workbook everytime I open it by getting the data from the ftp file. This will be the service number for my customer. Both the excel and the data file are located in the ftp, so that I can retrieve the file wherever I go. Basically I got some code from the internet which work fine on the local network, but once it come to ftp server I am stuck there.
Public Function NextSeqNumber(Optional sFileName As String, Optional nSeqNumber As Long = -1) As Long
Const sDEFAULT_PATH As String = "Ftp://mycompany.com"
Const sDEFAULT_FNAME As String = "Service.txt"
Dim nFileNumber As Long
nFileNumber = FreeFile
If sFileName = "" Then sFileName = sDEFAULT_FNAME
If InStr(sFileName, Application.PathSeparator) = 0 Then _
sFileName = sDEFAULT_PATH & Application.PathSeparator & sFileName
If nSeqNumber = -1& Then
If Dir(sFileName) <> "" Then
Open sFileName For Input As nFileNumber
Input #nFileNumber, nSeqNumber..................
View 2 Replies
View Related
Jan 30, 2013
How to pull data with a VLOOKUP to a file located on a Server.
My big problem is not understanding the syntax of the Server location. I've provided it below (obviously with some character changes).
I have a file located on my Hard Drive. I need to perform a VLOOKUP from A2 on this spreadsheet. The File on the Server is called "LookupTest.xls". The Range of Data is from Sheet 1 and is from A2:C4 and I need to pull the data from column C depending on what is selected from A2 from the file on my HD. I understand how to use VLOOKUP, just not when I'm pointing to another file on a Server.
Server mapping from Windows Explorer:
rbbabc$ on 'RP17409 - ABC Database (AHSSRVVN678.tge.com)'
Again, that server mapping is fake, as I changed it, but this is how it looks on Windows Explorer.
I'm trying to keep a master file of Data on a spreadsheet found on a server so that one master file can be updated, and several other tools pull from that Master File on VLOOKUP, Validation Lists, etc.
View 4 Replies
View Related
Sep 24, 2006
to copy files on computer which runs excell.
But is there a way to copy files from/to servers?
View 3 Replies
View Related
Jul 18, 2014
Any code that will grab the names of all files from all directories on an FTP server? I have the path & credentials to get to them, but I need a process to drop their names into a spreadsheet to compare against a list of files loaded onto a SQL database.
The directory structure on the server is subject to change, as are the number of files in each repository.
View 1 Replies
View Related
May 22, 2009
I have a macro which saves file to a specific folder. Problem is I can save the file only in my local drive C: but not on a server for some reason.
Here is the
At home in my home computer this code worked when C: was selected.
ChDir ("c:")
Title = Application.GetSaveAsFilename(Name, "Excel files (*.xls), *.xls")
ActiveWorkbook.SaveAs Name
Save the file in specific place
But when I substituted C: path with my server path it doesnt work! Have a look. Its the exact same code except my path is different.
ChDir ("\Lnf001Lnf1vol1SharedOP_ENGWork Order")
Title = Application.GetSaveAsFilename(Name, "Excel files (*.xls), *.xls")
ActiveWorkbook.SaveAs Name
View 9 Replies
View Related
Dec 8, 2013
I need to fetch corresponding data value from a data set which is spread across the sheet horizontally as well vertically. i need the net sales and net profit figures to fetched to a different worksheet/book. i have quarterly data horizontally and yearly data vertically. Below is a table in a horizontal manner. How to automate or less-time-consuming
Output required as:
period 6-30-2000 9-30-2000
net sales ........ ............
net profit ....... ............
Type
Un-Audited
Date Begin
4-1-2000
Date End
6-30-2000
[Code] ......
View 4 Replies
View Related
Mar 26, 2008
I have a sheet which has certain formulas & charts. I have a folder which has several workbooks of data.
Generally, I open the folder, open one workbook, copy the data, paste it to my Master Workbook, and based on this data, my charts update.
Now, the problem is that, I have to open every workbook one by one, copy and paste it to the master.
I have not less then 210 workbooks. I just want to know if it is possible to open the folder, open the desired workbook, copy the specific data and past it to master workbook, FROM Maste workbook itself.
View 9 Replies
View Related
Feb 6, 2014
I'm using VBA to upload the open workbook to app.box URL which is working great! Since I'm pretty new to VBA, I can't figure out how to get Excel to display the sucess/failed message from the server to the user. I used the VBA POST upload module from this awesome tutorial, but I can't figure out how to return the message to the user. I did figure out that on the website there is an "id="after_upload_message", not sure if that works. My code is below.
[Code] ......
View 2 Replies
View Related
Apr 2, 2009
Fetch data from the table on the page given by the link below..
http://www.moneycontrol.com/stocks/f...l&sort_order=0
View 9 Replies
View Related
Sep 12, 2013
I tried to use the following code to get data from an ASPX webpage:
[URL]....
VB:
Sub Fetch_Marcas()
Dim IeTbl As Object
Dim obj As Object
Dim Scrn As String
Dim objIE As SHDocVw.InternetExplorer 'Microsoft Internet controls (shdocvw.dll)
[Code]....
However, I cannot get past the point where I click over the register (highlighted in yellow in Picture 1), to get the data displayed at Picture 2.
Picture 1
Picture 1.jpg
Picture 2
Picture 2.jpg
Please note that this query requires to click over what is not a button (I looked in the forum, but no similar question was made before on this topic).
View 6 Replies
View Related
Aug 20, 2013
I would like to be able to have Excel VBA pull down the data from the following website.
The first URL will take you to the website, but you then need to select a state shown in bold from the Radio side of the index window in the middle of the screen. Once at the next screen, this is the table I wish to download into excel.
I want to do this for all the states listed. How can I do this or is it possible since you have to select a state prior to the listing.
HTML Code: [URL] ..... I found this code from anothe thread but it did not work.
Code:
Sub GetData()
Dim x As Long, y As Long, t As Long
Dim htm As Object
[Code] ....
View 1 Replies
View Related
May 27, 2014
Macro to copy data from Excel sheet and creates a Pipe delimited text file.
View 10 Replies
View Related
Aug 22, 2013
I have a database in sql server i want to make a excel form where in a user will enter the data and print the excel file
E.g.
S.NoDESCRIPTIONPART NO
I want a user to write the item description and data should come directly from database .
View 4 Replies
View Related
Dec 20, 2013
So the problem is that I have two workbooks: one has a set of identifying values which are a subset of one of the sets of values in the second and I need to match them up. In addition I need to take the values two columns to the right of the matched values in the second workbook and put them in the first.
Here is what my formula looks like now.
=IF(A5=VLOOKUP(A5,'[WBOOK2]Sheet1'!$A:$A,1,TRUE),INDEX('[WBOOK2]Sheet1'!,MATCH(A5,'[WBOOK2]Sheet1'!$A:$A,0),3),"NF")
Whenever I try to run it an error message comes up and highlights the match function name.
View 12 Replies
View Related
Nov 2, 2013
I have created a macro that creates a powerpoint from excel in office 2010. I have followed all the required steps, like adding object library and all. but still many times the PowerPoint crashes at slide7, 8 or 9 and have to restart. I generally get the above given error.
Code:
Sub CreatePowerPoint()
Application.ScreenUpdating = False
'Macro Created by Pallavi NC (pallavi.nc@hp.com)
'Add a reference to the Microsoft PowerPoint Library by:
'1. Go to Tools in the VBA menu
'2. Click on Reference
'3. Scroll down to Microsoft PowerPoint X.0 Object Library, check the box, and press Okay
'First we declare the variables we will be using
[code].....
View 1 Replies
View Related
Sep 17, 2009
Our small company only has 5 computers in it with mine acting as the "server". I want to put a macro on our customer order forms that all computers can access on the server that will save the file as 3 or 4 cell names serparated by commas and save it in a specific location on the server.
I got the macro to work perfectly on my computer but when I try to type in the appropriate path to the server the file gets saved in their My Documents folder 99% of the time. I did get it to work twice but it seembed to be completely random as it didn't work any of the times before or after.
Here's what I have so far: ...
View 9 Replies
View Related
Sep 25, 2013
Not exactly what year of Microsoft Excel we have at work buts its between 2007 to 2010.
Doing our weekly KPI on a friday is super stressful and if there is a way so multiple users can edit the excel spreadsheet at the same time?
Because with our excel spreadsheet only one person can edit the document at a time very frustrating at the end of a day on a friday.
Is it just Microsoft not allowing more than one editor at a time?
View 1 Replies
View Related
Mar 11, 2008
I have used the following piece of code to stop error checking in my excel spreadsheet:
Option Explicit
Private Sub Workbook_Open()
' Application.ErrorCheckingOptions.BackgroundChecking = False
End Sub
The problem is - works fine on my computer, but when distributed on the server the folloeing error is returned:
Run-time error '438':
Object doesn 't support this property or method
View 9 Replies
View Related
Nov 25, 2008
This code should retrieve data from sql server to excel sheet
filtering according to the "where" statement
its a modified recorded macro.
View 7 Replies
View Related
Jul 29, 2009
I need to run multiple queries and insert their results into Excel cells. Each query will return only one result (a number, or a null). What is the best way to accomplish this?
Below is an example of the code I'm currently using. It does return data to the cell specified, but I'm guessing there's an easier way to populate multiple cells with the results of multiple queries.
View 14 Replies
View Related
Dec 11, 2012
A user has an excel document and there are 5 specific cells they need to populate. The data is in one of our SQL databases. Is it possible to create a new copy of that excel doc with those fields populated for each record? There are around 2000 records they don't want to manually populate each one.
View 1 Replies
View Related