mysticmario
Active Member
- Joined
- Nov 10, 2021
- Messages
- 323
- Office Version
- 365
- Platform
- Windows
Hi,
I have this code that should ask for path, but for some reason it does not open any file dialog, what am I missing?
I have this code that should ask for path, but for some reason it does not open any file dialog, what am I missing?
VBA Code:
Sub Publish()
Dim savelociation As String
Dim ChDir As FileDialog
ThisWorkbook.Sheets("OTWARTE PROJEKTY").Activate
Set ChDir = Application.FileDialog(msoFileDialogFilePicker)
'ChDir ("G:\Mój dysk\ArtProInfo v1.5_Shared")
With ThisWorkbook.PublishObjects("ArtProInfo v1.5_8106")
.FileName = ChDir & "\" & "index.html"
.Publish (False)
.AutoRepublish = False
End With
Application.DisplayAlerts = False
ThisWorkbook.Sheets("OTWARTE PROJEKTY").Copy
savelocation = ChDir & "\" & "projekty.csv"
ActiveWorkbook.SaveAs FileName:=savelocation, FileFormat:=xlCSV, CreateBackup:=False
ActiveWorkbook.Close
Application.DisplayAlerts = True
ThisWorkbook.Sheets("OTWARTE PROJEKTY").Activate
End Sub
Last edited: