Where Are Macros Stored
Jun 30, 2006Where are Macros stored? Are they stored just in the worksheet, or are they stored locally on the machine?
View 3 RepliesWhere are Macros stored? Are they stored just in the worksheet, or are they stored locally on the machine?
View 3 RepliesI have an Excel 2003 program that contains macros. One of the macros hides certain command bars and disables the worksheet menu bar. On close the opposite is true. The problem is, if a user uses the disable macros when opening then the worksheet menu bar and other command bars are still available. I would like to hide all of the data sheets and display another sheet that would normally be hidden displaying a message that the macros have to be enabled for the program to work correctly if disable macros is chosen. When the enable macros are used I would like the Error page to be hidden.
View 6 Replies View RelatedMS Query can only hold 16 joins and some other restrictive requirements. Has utilized Stored Procedures to execute a query and have the results returned to Excel? Query in Excel seems very limited.
View 2 Replies View RelatedI need to call a Stored Procedure in a SQL Server from VB, but do not have the minimun Idea about doing it....Could you help me ?...I made a lot of attemps copiying code from other treads and scratch it, but so far results = none.
Server name: VAIO/SERVIDOR
DataBase: CEDRO
I΄m using Excel XP.
Any way to actually execute a macro stored as a text file?
Without being long winded - I want to create different macro and physically save them as text files. Once saved - I could call them from a list.
I'm trying to open multiple files, pass them into an array and then work on them but the code below doesn't work (receive a Run-time error '9' message)
Public aFile As Variant
Sub MultipleFiles ()
MsgBox ("Please select multiple book files (holding CTRL as you click on flies) before you click open")
aFile = Application.GetOpenFilename(FileFilter:="Excel (*.xl*), *.xl*", _
Title:="Select required book level files", MultiSelect:=True)
Dim i As Integer
For i = LBound(aFile) to UBound(aFile)
Workbooks(aFile(i)).Activate
'Do something, then repeat with next file in array
Next i
End Sub
I am opening a workbook using a macro. I need to run a macro in the workbook I am opening when it opens. I have created a variable containing the workbook name but don't know how to use it to run the macro.
Dim WBName
WBName = ActiveWorkbook.Name
Application.Run _
"'DIST_91094_EDTABS_DIABETES CARE_07072006.xls'!aStartProcess"
'DIST_91094_EDTABS_DIABETES CARE_07072006.xls'! needs to be replaced by the name stored in WBName
aStartProcess is the name of the macro in that workbook I want to run.
I have a user that keeps a maintenance log in an Excel worksheet and sends an updated copy once a week to a board member. Two weeks ago, the board member started complaining that he was prompted to enable/disable macros on opening and became worried when my user stated that no macros were used in the book. He is now concerned that we have sent him a virus.
I know the file is clean because I've scanned it, and when I look at the file in VB, there are no modules or classes present just the Sheets 1-3 and the ThisWorkbook file. None of these objects have any code in them. My user does have some macros in PERSONAL.XLS but they are not used in the workbook in question.
No one else gets the prompt for enabling/disabling macros. Even if I set my security to prompt for any macros, I get no message. I'm convinced that there must be some setting in his Excel that is causing this individual to get this message. Is there anything else other than a macro that would cause this?
I do have the following problem:
When I use the SUMIF(S) function and a criteria range that has numbers stored as text (eg: '394) the unequal operator (<>) doesn't work.
=SUMIFS(B:B,C:C,"<>493") doesn't work
I'm able to get the salary of employee 493 by using "493" instead of "<>493", but it seems that with the unequal operator Excel starts treating this ID as number. The only work-around I found so far is to use a wildcard e.g. "<>*493" or "<>493*". Excel then treats it as text again, but this is dirty workaround. What happens if an employee with an ID e.g. 1493 shows up!?
"<>'493" or something doesn't work unfortuantely..
Employee ID
Salary
'250
10000
'493
13000
I am using the following code to run a Stored Procedure Query. It works perfect bringing back 4 columns of data. But is it possible to make it so that it only brings back 2 columns of data. I need the 2nd and 4th, which are named "DateOf" and "Gen", respectively. Someway to include a select command?
I posted here, without luck: http://www.mrexcel.com/forum/showthread.php?t=367809
I have a table that extends from A1 to S630 (the number of rows changes as records are added and deleted).
The function to add rows based on the date is fine and I have implemented, but I cannot figure out how to delete a row based on a date.
The date is entered on a sheet called Calendar in Cell J20
so Sheets("Calendar").Range("J20")
and the date is in column B of the table, which has been made using the Table function
Is there a way of scanning through the whole table deleting all the rows with the date entered into J20 on the calendar sheet.
I have a spreadsheet which has over 30,000 records. One column is a row of numbers stored in a General format. Some of these numbers are however stored as Text and have the following Error Check:
"The number in this cell is stored as Text or preceded by an apostrophe"
As a result, when I try to import this sheet into Access, the numbers are not imported and appear as blank cells in the Table.
Is there a way either manually or programatically, format the column so all cells in that column are stored as a number and do not have the issue of being stored as text?
I'm creating my first stored procedure ever and it looks relatively good so far. The problem is with passing the parameters, more exactly:
Arguments are of wrong type, are out of acceptable range, or are in confilict with one another
The essential part of the stored procedure looks like:
Code:
CREATE PROC GetUserAuthForApp
@User varchar(7),
@application int
AS
while the essential code calling it from VBA looks like:
Code:
Dim strConn As String 'Connection string to SQL Server
Dim strSQLtoExecute As String 'SQL query string to execute
Dim oConn As ADODB.Connection 'Object for connecting
Dim rs As ADODB.Recordset 'Object for recordset
Dim cmd As ADODB.Command
Dim prmUser As ADODB.Parameter
Dim prmApplication As ADODB.Parameter
Dim stProcName As String 'Stored Procedure name
[code]....
and in that rs.Open comes that error.
What have I done wrong, how do I fix it?
Sub test12()
Set wbABC = Workbooks.Open("C:ABCwithMacro.xls")
Call abcMacro 'this macro is stored in ABCwithMacro.xls
'error - sub or function not defined on 'call abcMacro'
End Sub
I have a spreadsheet with data and I need to find text with spaces in one of the columns. How do I do that?
View 9 Replies View RelatedI've successfully saved an array of string to a workbook name. How do I get it back out as an array of strings instead of as a "Variant/String"?
View 4 Replies View RelatedIn a spreadsheet I have a text column with entries such as:
2012
10 Times
10.5 Times
101 Times
25 Times
A Pure Text Entry
When I sort by this column I expect to get:
10 Times
10.5 Times
101 Times
2012
25 Times
A Pure Text Entry
Instead I get the 1st order. Why? I've selected 'Sort numbers stored as text' separately so it shouldn't be treating 2012 as a number. Besides I've checked & the cell formatting is Text.
I have some code, in one part of it I am storing a number (between 1 and 8) as Integer. Is it possible to reference this variable to draw some rectangles on a sheet, sort of
"If MonitorDetail (this is the name of the variable) .value = 2 then
Here I place the code to draw the rectangle on the page. The macro currently stops at Monitordetail with a error telling me its a "Invalid Qualifier".
I just want to ask the user to enter the date in a mm/dd/yy format, however, the date received is some how changing.
For example I execute the following code and get 8/01/14 instead of 8/21/14
[Code].....
I have even tried pulling the date from a formatted cell with no luck.
Is it possible to call a stored proc from excel and pass through a paramter?
If it is would anyone have a clue how to do this?
I received one excel spreadsheet office 2010 every week from one on the vendor. it has over 55000 rows. I got columns N, O, P & Q. these columns has some value which I use for my pivot tables. However the values in this columns are stores as a text. I select the little small box (information box ) appears on the right side of the cell and right click on that where I get an option to change it to number. This is working well.
However I have over 55000 rows , it takes a lot of times to change all these cells in four columns ( almost over 220,000 cells). some times more than an hours.
I use excel 2010.
I am trying to find out if it possible to directly "access" (no play on words here) data stored on MS ACCESS by using Excel's formulas.
I have a set of tables stored on a Microsoft ACCESS 2010 database, and I want to use Excel to analyze that data, using formulas, such as SUMIF.
Is it possible, once I have established an Jet OLEDB connection from Excel to Access, to then directly exploit the data stored on Access without having to copy the data to Excel, and then use it.
I would like Excel to solely act as a tool to analyze, not to store data.
How to import data from an access database, specific tables, to excel using vba; the trick being the database is stored on SharePoint Server 2010.
View 2 Replies View Relatedthis example runs a named query in Access but it does not return the header row, just the data.
Code:
Sub RunAccessStoredQuery()
Dim objMyConn As New ADODB.Connection
Dim objMyRecordSet As New ADODB.Recordset
Dim strSQL As String
[Code].....
I would like a macro which works on the selected cells:
A number of the selected cells contain formulae with an apostrophe in the beginning.
I need the macro to remove the apostrophe and calculate the formula in those cells..
Sheet names in Col B
B2 : Sheet1
B3 : Sheet2
Etc
I tried
=INDIRECT(B3,$J$58)
at C3 where $J$58 is the cell I would like to reference on 50 different sheets
Formula returns #REF!
Col C ref's $J$58
Col D ref's $L$58
Col E ref's $N$58
Col F ref's $P$58
So as I copy the 4 formulas down, the ref to the correct sheet should update but the cell ref's should remain
I'm having trouble finding a way to switch between two workbooks that I have open whose names are stored as variables. If the variable name were variable, for example, I have tried the following:
workbook(variable).activate
workbook.activate variable
workbook(variable).select
workbook.select variable
none of these work and I've tried a ton of other ways to get it to work but I just can't figure it out!
I have a problem with entering 12-hour time data in excel.
If I key in 3:00, Excel will recognise it as 3:00 AM.
If I key in 3:00 p, Excel will recognise it as a text entry. To get Excel to recognise it as 3:00 PM, I have to use the 24-hour format. i.e. I have to type 15:00.
I have checked the Regional and Language option in the Control Panel. Everything looks fine.
Does anyone have such encounter with Excel before?
Column A contains numeric values that refer to a row number in column B. I need the value in column B to be outputted in column C. eg. if the value in Row 1 Column A = 55, the value in row 55 column B will be outputted in column C
View 3 Replies View RelatedI have numerous sub directories, C:/Jobs/12500 12599, C:/Jobs/12600 12699 etc, within these directories exist spreadsheets with file names like 12675.xls (in this case its in the 12600 12699 directory). In my open spreadsheet, in cell A1, there is a job number, say 12675. I want to find and open the existing 12675.xls spreadsheet. If the spreadsheet does not exist, a template (Costing.xlt), in a fixed directory, is opened and then saved, in the correct sub directory i.e. C:/Jobs/12600 12699/12675.xls. I am now using the following code, but the directory is fixed. How can it be modified to work with variable directories?
On Error Resume Next
Workbooks.Open Filename:="C:Spreadsheets" & Range("A1") & ".xls"
If Err <> 0 Then
Workbooks.Open Filename:="C:SpreadsheetsCosting.xlt"
ActiveWorkbook.SaveAs "C:Spreadsheets" & Range("A1") & ".xls"
End If
On Error Goto 0