query question

dantb

Active Member
Joined
Mar 20, 2002
Messages
358
Hi All, what I was wondering is if there is a vba to start (all query's in a workbook), I am trying to open a excel file that has query's in it, from an opened excel file. The file opens and all seams fine, but the automatic queries do not initiated. The queries are from xls dbase's. This is what I have been using to open the workbook. Thanks Dan
Private Sub Cmdcustomer_Click()
ChDir ("C:Unit Price")
NewFn = Application.GetOpenFilename(fileFilter:="Excel Files (*.xls), *.xls", Title:="")
If NewFn = False Then
Exit Sub
End If
Workbooks.Open Filename:=NewFn
Workbooks("Main.Xls").Close SaveChanges:=False
Exit Sub
End Sub
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi all finally figured it out. Needed a code in the workbook that I am opening. Incase anyone ever gets into the situation I was in, here it is, too simple

Private Sub Workbook_Open()
ActiveWorkbook.RefreshAll
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,909
Messages
6,122,189
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top