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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
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,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

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